Jquery :: Slideshow Breaks When Linking Image In DIV Set?
Aug 13, 2011
Below is a very simple jquery slideshow script which functions exactly as it should. But, if I link an image in the DIV set (See proposed change section) the slideshow breaks, instead of cycling through each image in turn it keeps trying to cycle the first image over and over. Script linking in header of HTML page:
<script type="text/javascript" src="script/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="script/slideshowsc.js"></script>
CSS on HTML controlling DIV position/opacity
#slideshow {
position:relative;
height:186px;
}
#slideshow IMG {
position:absolute;
top:0;
left:20px;
z-index:8;
opacity:0.0;
}
#slideshow IMG.active {
z-index:10;
opacity:1.0;
}
#slideshow IMG.last-active {
z-index:9;
}
DIV setup in HTML page
<div id="slideshow" style="padding-top:15px; text-align:center; width:540px; padding-bottom:43px;">
<img src="images/did-u-know1.png" width="499" height="186" border="0" class="active" />
<img src="images/did-u-know2.png" width="499" height="186" />
<img src="images/did-u-know3.png" width="499" height="186" />
</div>
Proposed Changi in DIV Code here
<div id="slideshow" style="padding-top:15px; text-align:center; width:540px; padding-bottom:43px;">
<a href="whatever.html><img src="images/did-u-know1.png" width="499" height="186" border="0" class="active" border="0" /></a>
<img src="images/did-u-know2.png" width="499" height="186" />
<img src="images/did-u-know3.png" width="499" height="186" />
</div>
Finally, Javascript / Jquery fired through body tag onload
function slideSwitch() {
var $active = $('#slideshow IMG.active');
if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
// use this to pull the images in the order they appear in the markup
var $next = $active.next().length ? $active.next()
: $('#slideshow IMG:first');
// uncomment the 3 lines below to pull the images in random order
// var $sibs = $active.siblings();
// var rndNum = Math.floor(Math.random() * $sibs.length );
// var $next = $( $sibs[ rndNum ] );
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "slideSwitch()", 8000 );
});
View 1 Replies
ADVERTISEMENT
Jun 1, 2011
i have a small image slideshow i want add a text slideshow to image slideshow. how is it?
my code:
<!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">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
[Code]....
View 7 Replies
View Related
Aug 4, 2011
I have an image that I start out with opacity = 0. Then when I rollover the image area the opacity is set to 1 so I can see the image, and when I roll off of the image the opacity is set back to 0:
This works fine. But the image has an image map that defines a small hot spot. When I roll over the hot spot the image hover state is interrupted and the image goes away. Does anyone know how I can keep the image hover state active when rolling over the image hot spot?
View 3 Replies
View Related
Sep 30, 2011
I'm working on a gallery site using galleriffic. It is composed of 13 seperate galleries (couldn't figure out a way to integrate them into one) and what I would like is an index page which users can jump to any specific image in a gallery. [URL]. There is a current example, and what I'm trying to do is make a drop down menu form where someone could select a piece of granite, (eg. Giallo Latina) and it would jump them straight to that page. However if I link to "butterscotch.html#5" it doesn't work. Is there any way of creating a drop down menu that could handle this?
View 2 Replies
View Related
Jan 15, 2003
I'm trying to get a simple script to run where it cycles thru a few images with corresponding links and displays them on a page. I get the script to run 2 times then it breaks on the third with a runtime error saying "object expected Line 0". Code:
View 1 Replies
View Related
Apr 2, 2008
I am currently in Web Design I class. I do not yet know javascript. However, I am currently making a music page and I am using the Phatfusion Image Menu as my navigation. What the Image Menu does is it cascades and expands when moused over, revealing an image, which can be a link. When clicked, the image stays in it's expanded form so that the user can see which page he/she is currently on. The problem is that I can get the menu to work correctly and open a new window, but that is not what I want it to do. What I want is for the menu to stay expanded (without refreshing) when an image (link) is clicked, but I want the rest of the page to change.
I believe that the problem is in the javascript: I don't know how to code in javascript well.
Here is the section I am currently looking at.
Code:
Right now, alert makes a javascript alert telling the user the link. If I change alert to open, it opens the link in a new window. How do I get a new page to load without reloading the menu? I want the page to load behind the menu.
The links I am using are here:
Code:
This is the main javascript code if it is needed.
Code:
Licence: Open Source MIT Licence
View 2 Replies
View Related
Jul 23, 2005
I have a page with a large centre-aligned image on it. I want a
functionality whereby users can click their mouse on any point in this
image and it would then show a virtual mouse pointer at the place where
they clicked it. If they were to click somewhere else, the position of
the virtual cursor would change.
The position of the cursor needs to dynamically generate a link and
display it in a form field text edit box.
If that link is then viewed separately, it would launch the same page
with the virtual mouse pointer at the location where the original
person placed it.
Basically I want to be able to have one guy point to a location on the
image for the benefit of another guy, but graphically as opposed to
relying on written explanation.
View 1 Replies
View Related
Sep 5, 2011
I have put together an image gallery that contains links to each individual image, however, I would like to link to individual images on a separate html document and cannot for the life of me determine how to go about doing this.
rnmix
Code:
<html>
<head>
<script type="text/javascript">
[Code]....
View 1 Replies
View Related
May 31, 2010
This is what I am seeking: On the main page we have 3 different images (img1, img2, img3), that must link to another page (photo page) with a photo in the middle enlarged: for example if I click img1 i will go to the photo page with img1 enlarged in the middle, and if I click img2 will go to the photo page with img2 in the middle. the photo page has photo thumbnail sliding at the bottom of the page that links to the same middle enlarged photo based on the clicked photo. is it doable with JS? or should I look somewhere else?
View 1 Replies
View Related
Jun 12, 2011
I have a basic 3 image slideshow banner for a website, but it loops and I'd like it to stop on the last banner image instead of start over. Here is the code I have, but I don't know what to do to stop the slideshow once the last image is displayed:
<div id="mySlider">
<div id="slider">
<!-- start slideshow -->
[code]....
View 5 Replies
View Related
Dec 3, 2009
I have some javascript for a jQuery slideshow, I need to make it autorun to the next image, but I don't know what I need to change in the code to make this happen. I got the script from this jQuery slideshow: [URL]
Code JavaScript:
$(document).ready(function(){
current = 1;
button = 1;
images = 10;
width = 480;
$('#p1').animate({"left": "0px"}, 400, "swing");
$('#b1').css("backgroundPosition", "left bottom")
$('#b1 b').css("color","#fff"); .....
View 2 Replies
View Related
Jun 23, 2011
I've made a simple slideshow from images in an array. I've search for a way to add elements to each "slide", in addition to the image, but they only pertain to image attributes (title, alt, url, etc.). Is there a way to create classes (for elements other than images, like header text and a content paragraph) in my javascript that can be added to each slide's array (and stylized in css)?This is my current code:
var infoData =[
'images/image1.jpg',
'images/image2.jpg',
[code].....
View 1 Replies
View Related
Nov 12, 2011
I am trying to change the url link associated w/ an image as each imageprogressesthrough a slideshow.I want each image to link to a unique page.
[Code]...
View 1 Replies
View Related
Aug 15, 2009
i need a slieshow effec that i want to create for my personal website. following is what i need i want to display an image and below that will be text and this text should be clickable and open in a new window and this way i want to show few images and text with a certain duration for each. there should be no left arrow and right arrow, instead each picture along with the text should move from the right to left or from left to right and stay for few seconds and the next one should appear and the text should be clickable and open in a new window. can anyone refer me to a website from where i can get this effect.
View 1 Replies
View Related
Aug 5, 2010
I'm using a jquery script to have a background image slideshow, but I can't make the images to shuffle. I need to do this, as on every click on the website, page reloads, and the background slideshow starts again on the first picture. I would prefer a random pic start.
The script so far is doing the job on covering the whole browser screen, fade on transition, and user controls (back, play / pause, next), wich I need to keep.
var slideshowSpeed = 10000;
var photos = [
{
"image" : "01.jpg",
[Code]....
View 1 Replies
View Related
Feb 26, 2011
I am trying to create an image gallery, with two buttons next and previous which work fine, and with a counter like (1/10) etc. I've got it to work but for some reason the slideshow never counts the first image so therefore is always one image behind. Somebody pointed out to me it is probably that the array starts at 0 and something else at 1
[Code]...
View 1 Replies
View Related
Mar 26, 2010
I am trying to have text that is placed over an image cross fade into another image with text placed over it. I am using jquery and the images are cross fading perfectly. The text isn't working so well and in Firefox it seems to be very choppy and even sometimes the text just disappears and then there is a blank slide without any text or the text is showing up on the wrong image. Here is the code I have so far:
HTML Code:
<div id="slides">
<div class="slide">
<img src="_images/placeholder3.jpg" width="695" height="195" alt="A Passion for Service" />
<div class="slideText">
<h1>And A Different Heading</h1>
<p>With the appropriate solution for each client, we provide biomedical engineering and information technology services to suit your needs.</p>
[Code]...
I am new to jquery and am going through the Sitepoint book "JQuery: Novice to Ninja. I am using the crossfade code from the book and I tried to apply it to the text as well.
View 2 Replies
View Related
May 27, 2011
I write simple slideshow on jQuery but I can't understand how to change current image count. Here is my current code:
HTML Code:
<script type="text/javascript">
$(document).ready(function(){
$('#slideshow img').hide();
$('#slideshow img:first').show();
function slide(){
var $top = $('#slideshow img:visible');
var $next;
if ($top.next().length > 0)
$next = $top.next();
else
$next = $('#slideshow img:first');
$top.hide();
$next.show();
}
var $imgCount = $('#slideshow img');
var $iCount = $imgCount.length;
$('#slideshow img').click(slide);
$('#totalImages').text($iCount);
});
</script>
I'm trying make like this 2/45, where 2 - is current image number.
View 3 Replies
View Related
Sep 30, 2011
In my website I have a slideshow that is working properly with this jQuery code:
Code:
$(function(){$('.fadein img:gt(0)').hide();
setInterval(function(){
$('.fadein :first-child').fadeOut(2000)
.next('img').fadeIn(2000)
.end().appendTo('.fadein');},
5000);
});
In another page I call one HTML file by the function .load with some imgs sources exactly as I have in my main page slideshow that is working well. The problem is that this last slideshow (that I call the images with the .load function) is not working properly as you can see here (too hard to explain, better just see, 1st thumbnail). I call the HTML file with this code:
Code:
$('#hab_ab').click(function(){
$('#target').removeClass('thumbs').load('slideshows/arq/hab/boavista/ab_ss.html');
I use .removeClass because of the positioning...
View 1 Replies
View Related
Aug 18, 2010
So Im trying to create a slideshow with thumbnails the user can scroll through and use to navigate the slideshow. I'm a big fan of cycle so I wanted to use that as my main slideshow component and was planning on using jcarousel for the pager. So far it works great in Firefox, Chrome, and Safari, yet in IE the thumbnails are not loading. I'm guessing it has something to do with how the images in the pager are generated and then jcarousel just isnt proccessing that in IE but I 'm not sure. I feel like I'm very close to getting this slideshow to work, yet I need to figure out why it is failing in IE.
[Code]...
View 2 Replies
View Related
Nov 25, 2009
I am using a simple prototype slideshow and a more comprehensive jquery slideshow on my website.When these are used on the same webpage on my website there appears to be a collision: (For example)Code:element.attachEvent is not a function[Break on this error] element.attachEvent("on" + actualEventName, responder); How can I avoid the conflict without reverting to a new slideshow?
View 1 Replies
View Related
Jan 9, 2006
I am trying to write a script to display pictures. I have the following code which works OK for displaying the next or prior picture. I know there are plenty of scripts out there for this, but I want to do it myself. So, I'll worry about the pause/play later. I dont know how to write the image using javascript. My problem that I currently want to fix is the first picture displayed is not initialized; that is, the variable I guess. I am passing the directory name, which is this first function. So, I have to click NEXT or BACK (my buttons) to display the first picture (actually the 2nd)... Code:
View 3 Replies
View Related
Jun 17, 2006
I'm hoping that someone can answer what is probably a really simple question. I've got the Random Image Slideshow script from javascript.com and have it placed in my site where I want it. Now how do I get it to read where I've got the images I want displaying? The folder I have is called homeimages with 10 photos currently inside it.
The script is:
View 5 Replies
View Related
Mar 28, 2011
I've got a script at present which allows me to cycle through images stored in an array as a slide show on a timed basis per each one.What I would like to do is have a 2nd array which has .wav files and when the first image is shown the first sound clip in the 2nd array plays and when finished the 2nd image shows followed by the playing of the 2nd sound clip in the array.If It is not possible to move images when the sound finishes I will set the length but would like to play the sound clips with the image.My code is shown below :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
[code]....
View 2 Replies
View Related
Jun 10, 2009
I'm going to set up a fade-in/fade-out slideshow, probably with jquery, that will loop through a list of images. But I only want the very first image to be shown once and then not again, even if the screen is refreshed. I don't know much about how to do that but I'm guessing it has something to do with a session, or cookies?
View 10 Replies
View Related
Dec 19, 2005
How could I make a random image slideshow with the images being in a folder and not listed in the head tag? (I have over 1,000 images and do not want to list them all in my index page)?
View 1 Replies
View Related