Slick Slider not working in AngularJS app - html

I've added all scripts and css, it is working when the html page alone runs, but not when the app runs. Nothing is showing in the console. I've tried adding css and js references in index page too.
What may be the problem?
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.5/slick.min.css'>
<div class="slider responsive">
<div>
<img src="http://placehold.it/200x150" alt="" />
</div>
<div>
<img src="http://placehold.it/200x150" alt="" />
</div>
<div>
<img src="http://placehold.it/200x150" alt="" />
</div>
<div>
<img src="http://placehold.it/200x150" alt="" />
</div>
<div>
<img src="http://placehold.it/200x150" alt="" />
</div>
<div>
<img src="http://placehold.it/200x150" alt="" />
</div>
<div>
<img src="http://placehold.it/200x150" alt="" />
</div>
<div>
<img src="http://placehold.it/200x150" alt="" />
</div>
</div>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.5/slick.min.js'></script>
<script src="js/slider.js"></script>
<script>
$(function () {
$('.slider').slick();
});
</script>

You mention its an angularjs App, but I dont see angularJS referenced in your HTML. If you want an angularJS version of slick carousel, please check this out:
http://devmark.github.io/angular-slick-carousel/#/
Let me know how it goes.
Note: This should have been a comment , but answering as I dont have enough points to comment.

Related

Owl Carousel only shows one item and buttons

I'm trying to build a carousel with Owl Carousel, but it doesn't show anything (only circle buttons and one item)
I can't figure it out that what's wrong with the code and why can't I use it properly.
Here is the code:
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css"
/>
</head>
<body>
<div class="my-div">
<div class="test owl-theme owl-carousel">
<div class="test-item"
><h4>test</h4>
<p> this is a test </p>
<div>
<img src="https://cv.octascript.com/images/Tooska.jpg" alt="" />
</div>
</div>
<div class="test-item"
><h4>test</h4>
<p> this is a test </p>
<div>
<img src="https://cv.octascript.com/images/Bilit.jpg" alt="" />
</div>
</div>
<div class="test-item"
><h4>test</h4>
<p> this is a test </p>
<div>
<img
src="https://cv.octascript.com/images/ElhamZareei.jpg"
alt=""
/>
</div>
</div>
<div class="test-item"
><h4>test</h4>
<p> this is a test </p>
<div>
<img src="https://cv.octascript.com/images/Tooska.jpg" alt="" />
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.js"></script>
<script>
$(".test").owlCarousel({
loop: true,
margin: 20,
responsive: {
0: {
items: 1,
},
600: {
items: 2,
},
1000: {
items: 3,
},
},
});
</script>
</body>
</html>
I tried videos and documents and toturials but couldn't solve it.
And of course I used both CDN and local files but the result was still the same.

Background image not appearing

The background image in the shadow_div is not appearing as it is expected to be .
Although rest of the images are loading and appearing properly which are in mySlider div
but what about the background-image of the shadow_div?
<!DOCTYPE html>
<html>
<head>
<title>jQuery UI Dialog: Hide the Close Button/Title Bar</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function () {
});
</script>
<style type="text/css">
.mySlider
{
width:800px;
height:480px;
overflow:hidden;
margin:10px auto;
}
.shadow_div
{
background-image:url(Images\shadow.png);
background-repeat:no-repeat;
background-position:top;
width:510px;
height:296px;
margin:-90px auto;
}
</style>
</head>
<body>
<div id="my_image_slider" class="mySlider">
<img src="Images\audi.jpg" alt="" title="Audi India"/>
<img src="Images\bmw.jpg" alt="" title="BMW India" />
<img src="Images\aston-martin.jpg" alt="" title="Aston-Martin APAC" />
<img src="Images\bugatti.jpg" alt="" title="Buggatti APAC" />
<img src="Images\koenigsegg.jpg" alt="" title="Koenigsegg APAC" />
</div><br />
<div class="shadow_div" ></div>
</body>
</html>
you are using Backslash \ symbol.
<img src="Images\audi.jpg" alt="" title="Audi India"/>
you should use Forward Slash / Symbol . also make sure image path is right.
<img src="Images/audi.jpg" alt="" title="Audi India"/>
Here you can see the image in class .shadow_div is appearing. See the DEMO.
Your image is not getting correct path: try this below, as you are using forward slash '\'
instead of backslash '/'
<img src="Images/audi.jpg" alt="" title="Audi India"/>
<img src="Image/bmw.jpg" alt="" title="BMW India" />
<img src="Image/aston-martin.jpg" alt="" title="Aston-Martin APAC" />
<img src="Image/bugatti.jpg" alt="" title="Buggatti APAC" />
<img src="Image/koenigsegg.jpg" alt="" title="Koenigsegg APAC" />

Cannot link image to url (<img> tag inside of <a> tag not working for slideshow)

I have a slideshow and I want to link each slide to some url, which should be easy, but it's not working.
I'm using the slider from here: http://dev7studios.com/lean-slider/
If you don't want to download the code, I guess you can just use inspect element and edit it to test it yourself.
...
<div class="slide1 lean-slider-slide">
<img src="images/1.jpg" alt="" />
</div>
...
I also tried using onclick with javascript with no luck.
<script>
function test(){
document.location.href = 'http://www.google.com';
}
</script>
<img src="images/1.jpg" alt="" onclick="test()" />
I uploaded the default demo version to my website, linking all images to google.com. I have not made any changes to the original code other than adding the links. I assume that you've already tried that but I cannot see what the issue could be. Usually problems like these have to do with paths to scripts and stylesheets but these seem pretty straightforward. At least there's a working example to go by. The code I'm using is below.
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8" />
<title>Lean Slider Demo</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<script src="scripts/modernizr-2.6.1.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="../lean-slider.js"></script>
<link rel="stylesheet" href="../lean-slider.css" type="text/css" />
<link rel="stylesheet" href="sample-styles.css" type="text/css" />
</head>
<body>
<div class="slider-wrapper">
<div id="slider">
<div class="slide1">
</><img src="images/1.jpg" alt="" />
</div>
<div class="slide2">
<img src="images/2.jpg" alt="" />
</div>
<div class="slide3">
<img src="images/3.jpg" alt="" />
</div>
<div class="slide4">
<img src="images/4.jpg" alt="" />
</div>
</div>
<div id="slider-direction-nav"></div>
<div id="slider-control-nav"></div>
</div>
<script type="text/javascript">
$(document).ready(function() {
var slider = $('#slider').leanSlider({
directionNav: '#slider-direction-nav',
controlNav: '#slider-control-nav'
});
});
</script>
</body>
</html>
Its not working correctly.
Expected is each image can have their own hyperlinks, but with lean-slider, only last hyperlink is applicable with all images.
In you case you have given google.com with each image so it seems it is working fine, but once you change each URL then you will notice that it is not going to last hyperlink.
Thanks,
Krishan
but the solution i cant have diferent URL´s, always take the last link; play with the css you can force the position of elements and enable yhe link for each image:
/*lean slider overwrite*/
#slider-control-nav, #slider-direction-nav
{
z-index:3;
}
.lean-slider-slide.current
{
z-index:2;
}
.lean-slider-slide.current a
{
float:left;
}

Twitter Feed on IE, Opera, Safari

I have a page in which I've implemented the Twitter feed widget. If works nicely on Firefox and Chrome, but on IE, Opera, and Safari, it just comes up with "Tweets by #JackSchaible" and not the actual feed itself. Someone please help?
The url is www.logicanddesign.ca
Alternatively, here's my source code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Logic & Design: Home</title>
<link rel="stylesheet" type="text/css" href="styles/divs.css" />
<link rel="stylesheet" type="text/css" href="styles/fonts.css" />
<link rel="stylesheet" type="text/css" href="styles/tags.css" />
<link rel="stylesheet" type="text/css" href="styles/images.css" />
<link rel="shortcut icon" href="images/Icon-OR.png" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="scripts/animations.js"></script>
<script src="scripts/socialMediaPlugins.js"></script>
</head>
<body>
<div id="wrapper">
<header>
<img id="logo" alt="logo" src="images/Logo.png" />
</header>
<div id="divider">
<img id="headerDivider" alt="Line" src="images/Line.jpg" />
</div>
<nav>
<div class="Button" id="selectedButton">
<img id="arrowOverlay" alt="Overlay" src="images/Arrows/FadeArrow.png" />
<img id="extender" alt="Home" src="Images/Arrows/Arrow%20Body.png" />
<img id="selectedArrow" alt="Home" src="Images/Arrows/Home/Home.png" />
</div>
<div class="Button" id="aboutButton">
<img alt="About Me" src="Images/Arrows/About/About.png"/>
</div>
<div class="Button" id="abilitiesButton">
<img alt="My Abilities" src="Images/Arrows/Abilities/Abilities.png"/>
</div>
<div class="Button" id="portfolioButton">
<img alt="My Portfolio" src="Images/Arrows/Portfolio/Portfolio.png"/>
</div>
<div class="Button" id="contactButton">
<img alt="Contact Me" src="Images/Arrows/Contact/Contact.png"/>
</div>
</nav>
<div id="mainContent">
<div id="innerContent">
<p>Welcome to Logic & Design! If you are looking for work done and it has anything to do with a computer, you have come to the right place! My name is Jack Schaible and I do nearly everything computer-related. Whether it is software analysis, design, web apps, database design, web design or development, whatever your needs, I can fill them. I will take care of the technical side of things so you can focus on what matters: running your business!</p>
</div>
</div>
<div id="imageBar">
<div id="networkingIcons">
<div id="fb" class="fb-like-box" data-href="http://www.facebook.com/logicanddesign" data-width="200" data-height="75" data-colorscheme="dark" data-show-faces="false" data-stream="false" data-header="false"></div>
<a class="twitter-timeline" href="https://twitter.com/JackSchaible" data-widget-id="266804071627898880">Tweets by #JackSchaible</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<div class="g-plus" data-width="199" data-height="69" data-href="https://plus.google.com/105579960548041650339" data-rel="author" data-theme="dark"></div>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-counter="right"></script>
</div>
</div>
<footer>
<p>© <script type="text/javascript">document.write((new Date).getFullYear());</script> Jack Schaible</p>
</footer>
</div>
</body>
</html>
It works on all of my browsers when it is accessed form a server http://localhost/twitter.html or http://www.logicanddesign.ca/ but not when viewed as html file: file:///C:/xampp/htdocs/twitter.html. This seems to be a nuance of the .js script.

Change image on hover

How can I change this exact code to do the hovering effect on mouseover?
I tried following some of the other questions and answers, but I could not really follow them.
So the HTML is:
<img src="R3.jpg" width=700 height=300 />
<div>
<img src="SSX.jpg" height=100 width=120 />
<img src="MaxPayne3Cover.jpg" height=100 width=120 />
<img src="NC.jpg" height=100 width=120 />
</br>
</div>
Now what I want to do is change the big size image when the mouse hovers over the small images.
Try this it`s so easy and the shortest one, just change the Image's URL:
<a href="TARGET URL GOES HERE">
<img src="URL OF FIRST IMAGE GOES HERE"
onmouseover="this.src='URL OF SECOND IMAGE GOES HERE';"
onmouseout="this.src='URL OF FIRST IMAGE GOES HERE';">
</a>
Try the following code. It's working
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title><br />
</head>
<body>
<p>
<script type="text/javascript" language="javascript">
function changeImage(img){
document.getElementById('bigImage').src=img;
}
</script>
<img src="../Pictures/lightcircle.png" alt="" width="284" height="156" id="bigImage" />
<p> </p>
<div>
<p>
<img src="../Pictures/lightcircle2.png" height=79 width=78 onmouseover="changeImage('../Pictures/lightcircle2.png')"/>
</p>
<p><img src="../Pictures/lightcircle.png" alt="" width="120" height="100" onmouseover="changeImage('../Pictures/lightcircle.png')"/></p>
<p><img src="../Pictures/lightcircle2.png" alt="" width="78" height="79" onmouseover="changeImage('../Pictures/lightcircle2.png')"/></p>
<p> </p>
</br>
</div>
</body>
</html>
I modified the code, like it will work with some delay in it.. But still, it is not animating..
function changeImage(img){
// document.getElementById('bigImage').src=img;
setTimeout(function() {document.getElementById('bigImage').src=img;},1250);
}
Or do like this:
<a href="SSX.html">
<img src="SSX.jpg"
onmouseover="this.src='SSX2.jpg';"
onmouseout="this.src='SSX.jpg';"
height=100
width=120 />
</a>
I think this is the easiest way.
No JavaScript needed if you are using this technique
<div class="effect">
<img class="image" src="image.jpg" />
<img class="image hover" src="image-hover.jpg" />
</div>
the you will need css to control it
.effect img.image{
/*type your css here which you want to use for both*/
}
.effect:hover img.image{
display:none;
}
.effect img.hover{
display:none;
}
.effect:hover img.hover{
display:block;
}
remember to give some class to div and mention it in your css name to avoid trouble :)
The easiest way for Roll Over image or Mouse Over image for web pages menus
<a href="#" onmouseover="document.myimage1.src='images/ipt_home2.png';"
onmouseout="document.myimage1.src='images/ipt_home1.png';">
<img src="images/ipt_home1.png" name="myimage1" />
</a>
<script type="text/javascript">
function changeImage(img){
img.src=URL_TO_NEW_IMAGE;
}
</script>
<a href="RR.html"><img id="bigImage"
onmouseover="changeImage(document.getElementById('bigImage'));"
src="R3.jpg"
width=700
height=300/></a>
<div>
<a href="SSX.html" ><img src="SSX.jpg" height=100 width=120/></a>
<img src="MaxPayne3Cover.jpg" height=100 width=120/>
<a href="NC.html" ><img src="NC.jpg" height=100 width=120/></a>
</br>
</div>
If you don't want to do Javascript you can use CSS and :hover selector to get the same effect.
Here's how:
index.html:
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<title>Image hover example</title>
</head>
<body>
<div class="change_img"></div>
</body>
</html>
stylesheet.css
.change_img { background-image:url('img.png'); }/*Normal Image*/
.change_img:hover { background-image:url('img_hover.png'); }/*On MouseOver*/
Just Use this:
Example:
<img src="http://nineplanets.org/planets.jpg"
onmouseover="this.src='http://nineplanets.org/planetorder.JPG';"
onmouseout="this.src='http://nineplanets.org/planets.jpg';">
</img>
Works best with the Pictures being the same size.
Copy This
<img src="IMG-1"
onmouseover="this.src='IMG-2';"
onmouseout="this.src='IMG-1';">
</img>
Here is a simplified code sample:
.change_img {
background-image: url(image1.jpg);
}
.change_img:hover {
background-image: url(image2.jpg);
}