8 guides to apply jQuery and ImageSwitch in web design


March 21, 2009
Twitter's a new exciting social media. And guess what, I'm quite active on it. Follow me on Twitter to get the latest links and updates.

another tip »

It’s a week since I released the new jQuery plugin, ImageSwitch and the result’s amazing. I have thousands of page views a day, link backs(even from Japan) and a lot of emails, twitter followers, subscriptions… Thank you everyone.

As I received many emails asking about how to use IS and improvements for the IS. In one weeks I worked hard to bring you some good news.

1. The release of new ImageSwitch 1.0.2

2. 8 guides to apply jQuery and IS into web design

The guides aren’t just cover jQuery and IS, it’s also cover some important javascript which could help you use javascript more effectively.

You could also download all the examples in a zip file here.

Flip Card Example
3 lines of code for 9 different effects Example
Interactive menu with fly in icon Example
Popular beautiful RSS fade in effect Example
My top navigation effect Example
Sequence of different effects Example
Slide show gallery with jQuery Example
Flip clock, the most interesting effect Example

New stable version of ImageSwitch: 1.0.2

As always, the first version will has a few problems even though I tested in different situations. With the new version, it will be more stable, more interactive and easier to control.

Don’t worry if you using the old version. The new version is back-compatible with the old one, so you don’t need to change your scripts, CSS or HTML.

There are some new features in this new version. I received a lot of request for ImagePreload function, so even it’s quite simple but it could be useful. Another function is ImageStop allow you to stop an animation and ImageAnimating to let you know if the object is Animating or not.

8 guides to apply jQuery and IS into web design

I received a lot of email said: my IS would be perfect for their galleries/slide shows websites. However IS is more than just for pictures galleries. It could also be used for almost any part of web design (which use images of cause).

Bellow is the tutorials guide you through the steps to make IS works for you. I also include download versions of all tutorials so you could learn from it. The CSS and Javascript codes are all included in HTML file to help you read it easier.

Flip the card

Example

Answer some FAQ: 

  1. Flip a card
  2. Preload images

It’s the first one in the series because it’s so simple. I read somewhere one of my visitor said he want to use the IS to assembly the card flip effect. I’m quite like that’s idea so I try to make it with my IS.

It’s quite simple with a few lines of code. There won’t be any problem with CSS as IS will take care of it.

So start with basic html for an image:

 

<img id="FlipInCard" src="images/pc1.jpg"/>

 

Now, we will need to add an event to this image so whenever users click on the image, it will flip to the next one.

 

$("#FlipInCard").click(function(){
	if(!$(this).ImageAnimating()){
		$(this).ImageSwitch({	Type:"FlipIn",
								NewImage:"images/pc"+ImgIdx+".jpg",
								EndLeft: 80,
								EndTop: -20,
								StartOpacity: 1,
								Speed: 500
								});
	}
	ImgIdx++;
	if(ImgIdx>3) ImgIdx = 1;
});

ImgIdx is a counter variable to keep track of which image will show up next. Also if the index is more than the maximum number, it will starts over again.

We use the FlipIn with some simple setting. Keep StartOpacity: 1 to make the card always at maximum opacity.

This tutorial also present a new function of ImageSwitch. Which is ImagePreload.

function PreloadImg(){
	$.ImagePreload("images/pc1.jpg");
	$.ImagePreload("images/pc2.jpg");
	$.ImagePreload("images/pc3.jpg");
}

The function is quite simple, it just loads all the image into the memory so there won’t be any delay when the effect start.

Try it now – 3 lines of code for 9 different effects

Example

I asked my friend, how many lines of javascript codes he think I have used to create the front page of ImageSwitch – which is 9 different effects. He said 36 lines, fair enough, 4 lines for each effect which is pretty short already. Or is it?

When I said the actual effects only 3 lines. He was like no way. Let’s see the code:

$(".SlashEff ul li").click(function(){
				$(".Slash").ImageSwitch({Type:$(this).attr("rel"),
											NewImage:"images/slash"+ImgIdx+".jpg"
										});

So how it works. Basically, in every effect trigger <li> I set the rel attribute is the name of the effect. So whenever users click on a trigger, I could get the name of the effect from that attribute. It’s more of a tricky way but it saves me a lot of time. Now let take a look at a sample line of the html as well, shall we.

 

  • Fade in
  • You could check full code in the HTML example file.

    Interactive menu with fly in icon

    Example

    This example is more likely used in web design. When users move the mouse over a link in the menu, create a attractive fly in effect for that icon.

    It wouldn’t be simple without IS, but with IS, it’s just a few simple line of options.

    So the effect will be trigger by event hover. This how I implement the fly in effect.

     

    $(".TriggerEffect").hover(function(e){
    	$(this).children("img").ImageStop(true,false);
    	$(this).children("img").ImageSwitch({	Type:"FlyIn",
    											NewImage:$(this).children("img").attr("src"),
    											EffectOriginal: false,
    											StartLeft: -20,
    											Speed: 500});
    	e.preventDefault();
    });

    First thing first, it will stop any animating of the current effect before it start fly in. Because IS only allows one effect run at a time for each object, if you not checking it, the new effect will have to wait for the current effect stop before it could run.

    A see a lot of people forgot to use e.preventDefault(). So what is it for? Say you have a link

     

    Test link

    Even it won’t lead to any where it still a link. So if you click on this link 10 times to try the effects, you will need to go back 11 times to get back to the page before this page. e.preventDefault() will stop this default event happen.

     

    If the icon flied in, than it should also fly out. So another IS for the fly out effect.

     

    				$(this).children("img").ImageStop(true,false);
    				$(this).children("img").ImageSwitch({	Type:"FlyOut",
    														NewImage:$(this).children("img").attr("src"),
    														EffectOriginal: false,
    														EndLeft: 20,
    														Speed: 500});
    
    				e.preventDefault();			

     

    Again, nothing special about the CSS. Just an image object next to a text. As simple as that:

     

    Email 

     

    Popular beautiful RSS fade in effect

    Example

    A lot of website’re using this effect. Even though it’s a straightforward effect, it still impresses a lot of people (include myself). I made one of my own on top of the page.

    Without IS, you will need to create a div with the background is the light grey RSS logo, inside that div, make an image object with src is the orange RSS logo, then set the orange RSS logo’s opacity = 0. After that, create a hover event to trigger the animation of the RSS logo opacity increasing and decreasing…

    Well, it’s easy, but how about this. Create an image object. Then using hover event IS between those two images. Sound much more straight forward right.

    Start with the code:

     

    		$(".TriggerEffect").hover(function(e){
    			$("#RSSImg").ImageStop(true,false);
    			$("#RSSImg").ImageSwitch({	Type:"FadeIn",
    										NewImage:"Images/RSSOrange.jpg",
    										EffectOriginal: false, Speed: 500});
    			e.preventDefault();
    		},function(e){
    			$("#RSSImg").ImageStop(true,false);
    			$("#RSSImg").ImageSwitch({	Type:"FadeIn",
    										NewImage:"Images/RSSbw.jpg",
    										EffectOriginal: false, speed: 500});
    
    			e.preventDefault();
    		});
    

    The same with the fly in effect. One IS for mouseover and one IS for mouseout. Make sure to keep the ImageStop on top so it will clear any animation which’s running before starting a new one.

    You will see I use EffectOriginal: false here. What is it actually do? ImageSwitch Fade In effect is actually 2 layers of image. The original image will be at the back. If we set EffectOriginal: true. The original image will fade out and the new image will fade in. It’s good for many cases but in middle of the animation, there is a bright image which is both of the image has opacity: 0.5. It’s not what we want in this situation.

    Another no CSS. HTML is also quite simple. An image with an <a> around it.

     

    		
    			
    		 

    My top navigation effect

    Example

    Another popular effect. When I visit NCover website, I love their front design with hand draw pictures. Whenever you move the mouse on top of a section, that image change to another one. The images are really good, but I was just thinking. Why they don’t use my IS, it would be amazing. And guess what, 5 lines of code for it. Again, why not???

    So let get to the code

     

    			$("#ImgObject").ImageStop(true,true);
    			$("#ImgObject").ImageSwitch({	Type:"FadeIn",
    											NewImage:$(this).attr("href"),
    											EffectOriginal: false,	Speed: 500});
    			e.preventDefault();

    So whenever user moves the mouse on top of a button, the big image will change to another one with fade in effect. Now you have more choices as IS support 9 different effects. Scroll or Door is also good in this situation. As you could see in the code, all the image link will be store in the <a> surround the image.

    The HTML is a bit more complex now and you also need to work a bit on the CSS. However, it’s only because of the way I layout my menu, it’s not effect the animation at all.

     

    The CSS will make sure all the <li> will be in one line. The size of the <a> will also set the size of the <li> as well. Which pretty the main problem.

     

    #BackgroundDiv{
    	background: url("images/topbg.jpg");
    	margin: 0 auto;
    	width: 968px;
    	height:354px;
    	position: relative;
    	overflow: hidden;
    }
    #SwitchImg{
    	left: 300px;
    	top: 124px;
    	position: absolute;
    }
    #TabMenu{
    	left: 460px;
    	top: 90px;
    	position: absolute;
    }
    #TabMenu ul li{
    	list-style-type: none;
    	margin-right:12px;
    	overflow: hidden;
    	float: left;
    }
    #TabMenu ul li a{
    	display: block;
    	width: 95px;
    	height: 30px;
    }

    The last 3 effects are much more complex (only compare to the ones above) and of course much much more interesting.

    Sequence of different effects

    Example

    1. Trigger effect without click event
    2. Run a sequence of different effects with different settings

    Right, so we want to run a list of different effects with IS as a continue animation. First thing we need to know is trigger the animation.

    We could trigger the animation by using :

     

    setInterval(StartAds,3000);

    So now it will trigger the StartAds function every 3 seconds.

    To store a sequence of effect with different setting, I use a multi-dimension array.

     

    	var ListEffect = [	["I make 3D", "I do script", "I play Lego"],
    						["ScrollIn", "ScrollOut", "ScrollIn"],
    						["TopDown", "LeftRight", "DownTop"]];
    

    Now we set a index variables and everytime trigger the StartAds functions, we increase the index by 1. Change the new image, and get the effect and the direction from the array list.

     

    			if(!$("#Ads").ImageAnimating()){
    				$("#Ads").ImageSwitch({	Type:ListEffect[1][ImgIdx],
    										NewImage:"images/Ads"+(ImgIdx+1)+".jpg",
    										Direction: ListEffect[2][ImgIdx],
    										StartOpacity: 1,
    										EndOpacity: 1,
    										Speed: 500
    										});
    			}

    You will see the title will hide when the effect start and come back again when the effect stop. To do that, we need a animate surround our IS image and another animate for that div after finish the animation. The code will look like this:

     

    		$("#Description").animate({"top": "-20px"},500,function(){
    			if(!$("#Ads").ImageAnimating()){
    				$("#Ads").ImageSwitch({	Type:ListEffect[1][ImgIdx],
    										NewImage:"images/Ads"+(ImgIdx+1)+".jpg",
    										Direction: ListEffect[2][ImgIdx],
    										StartOpacity: 1,
    										EndOpacity: 1,
    										Speed: 500
    										},function(){//Come back when the effect stop
    											$("#Description").html(ListEffect[0][ImgIdx]);
    											$("#Description").animate({"top": "0px"},500);
    											ImgIdx++;
    											if(ImgIdx>2) ImgIdx = 0;
    										});
    			}
    		});

    The HTML is just so plain, nothing special:

     

    I make 3D

    That’s it, we have a pretty cool sequence effects with minimum of codes.

    Slide show gallery with jQuery

    Example

    ImageSwitch was born for slide show, so when I think about make a list of way to apply IS in web design, this is on top of my list. With the power of jQuery combine with ImageSwitch, this work is just a piece of cake.

    This tutorial is also show you the use of index and eq in jQuery which become handy in a lot of situation.

    Now let’s start with the HTML structure, a big image to display the main image and a list of all thumbnail bellow it. Also, add trigger to start the animation.

     

    
    

     

    Ok, we need to create a function, which using the index of current thumbnail to switch the main image. I call it ChangeImage.

     

    		var ChangeImage = function(){
    			//If the image still animating, stop it and start the new one
    			$("#MainImage").ImageStop(true,true);
    			$("#MainImage").ImageSwitch({NewImage: $(".TnImage").eq(Idx).attr("src").replace("tn-","med-")});
    			//Mark which thumbnail is displaying
    			$(".TnImage").css("opacity","0.5");
    			$(".TnImage").eq(Idx).css("opacity","1");
    			//Set the next image will be display
    			Idx++;
    			if(Idx>3){
    				Idx = 0;
    			}
    			//Start preload the next image
    			$.ImagePreload($(".TnImage").eq(Idx).attr("src").replace("tn-","med-"));
    		};
    

    The main switch function is only the first two lines. The different between my thumbnails and the normal size images is the prefix, that why I need to change from tn to med. We also preload the next image, so there won’t be any delay when we start the next effect.

    You may also notice I increase Idx everytime the function called. The reason for that is to start the slide show we only need continuously call the function by setInterval.

    The work is simple now. Whenever user click on the thumbnail, we change the Idx and call the function ChangeImage.

     

    		$(".TnImage").click(function(){
    			Idx = $(".TnImage").index(this);
    			ChangeImage();
    		});		

    Start trigger the slide show by setInterval and call the ChangeImage every second.

     

    IntervalKey = setInterval(ChangeImage,1000);

    However, we could start the slide show, we should also allow user to stop it. We use the bind and unbind function of jQuery. Here is the fully code:

     

    		var StartSlideShow = function(){
    			IntervalKey = setInterval(ChangeImage,1000);
    			$("#SlideShow").text("Stop Slide show");
    			$("#SlideShow").unbind("click");
    			$("#SlideShow").bind("click",StopSlideShow);
    		};
    
    		var StopSlideShow = function(){
    			clearInterval(IntervalKey);
    			$("#SlideShow").text("Start Slide show");
    			$("#SlideShow").unbind("click");
    			$("#SlideShow").bind("click",StartSlideShow);
    		};
    
    		$("#SlideShow").bind("click",StartSlideShow);

    To create just a gallery is simple, special with the ImageSwitch. The a little bit complex part is only how to bind and unbind events. However when you get use to it. It’s not that’s hard after all.

    Flip clock, the most interesting effect

    Example

    This is the most interesting effect however unfortunately, it’s also the most useless effect. Can’t think of how you want to put a flip clock into you website. However it could be nice to stimulate the effect of, I don’t know, stock market information I guess.

    This is quite complex. You start by get the current time.

     

    var CurrentDate = new Date();

    Start by drawing the second. Get the second out, check to see if it is 1 or 2 characters. If it’s 1 character, set the first character = 0; You get the idea

     

    			//Set for seconds
    			var sec1 = 0;
    			var sec = 0;
    			if((CurrentDate.getSeconds()+"").length>1){
    				sec1 =(CurrentDate.getSeconds()+"").substr(1,1);
    				sec = (CurrentDate.getSeconds()+"").substr(0,1);
    			}else{
    				sec1 = (CurrentDate.getSeconds()+"").substr(0,1);
    			}		

    Now see if we need to change the flip clock for the first number. 

     

    			if($("#Sec").attr("src") != "images/c"+sec+".jpg")
    			{
    				$("#Sec").ImageSwitch({	Type:"ScrollIn",
    										NewImage:"images/c"+sec+".jpg",
    										Direction: "TopDown",
    										StartOpacity: 1,
    										Speed: 500
    										});
    			}

    Using the scroll in effect, a simple touch for an interesting effect.

    Then the second number.

     

    			$("#Sec1").ImageSwitch({Type:"ScrollIn",
    									NewImage:"images/c"+sec1+".jpg",
    									Direction: "TopDown",
    									StartOpacity: 1,
    									Speed: 500
    									});

    Now, that’s how it work. The reason the code is so long is because you need to repeat it for minutes and hours as well. Well just copy and paste really.

    To start the trigger right when the page ready. We use these codes:

     

    	$(document).ready(function(){
    		setInterval(DrawClock,1000);
    	});

    Conclusion

    With the help of ImageSwitch, I can’t seem to say any of these tutorial is difficult. It’s pretty straight forward. With just a bit of code, you could make your website much more interactive.

    I improve the plugin quite a lot since the first time it come out thank to the suggestions of my visitors. I know there are still potential for this plugin. If you find any effect you like, any idea which could be put in here. Please let me now. Also, if you have trouble with the plugins or the example, just email me, I will try to reply to you ASAP.

    Thank you

    Technorati Tags: ,
    • Delicious
    Under Category: jQuery
    Article Tags: ,
    March 21st, 2009

    Great job, thanks a lot!! Rly some excellent work.

    You do have to check the code to the slide show its send to a deadlink :)

    Dennis

    March 22nd, 2009

    Hi, thank Dennis, great help, I fixed the links. The reason the comment doesn’t display immediately is because it need to be approved, I will need to turn it off so all the comment will be display without approved.

    March 23rd, 2009

    I think you have to include preload into IS.
    Sometimes the effects doesn’t work because newimage didn’t loaded

    March 23rd, 2009

    Hi, in the new version, the preload is included into IS already. It will load the image first. When it finishes load the image, it starts the effect.

    If you want to load the image even before start the IS. You could use ImagePreload (which is included in IS)
    $.ImagePreload("images/pc1.jpg");

    March 31st, 2009
    Daz

    Hi. is there a way that you can link to a webpage for each of the images in the slideshow? And is is possible to be able to do next and previous??? Dont know if this is out of the scope of the project, but some advice would be great..cheers

    March 31st, 2009
    canute

    hi there
    im trying to apply the Slide show gallery with jQuery to a web im developing
    my question es: how i can add a link to the images that switch? the main ones?
    thanks!

    March 31st, 2009
    canute

    an also
    how i can make that the slideshow start automatically without user click?

    March 31st, 2009
    admin

    Hi, sorry as I’m at work I can’t answer the question too detail
    @Daz: to add a next button all you need to do is assign a function to an <a>. The function should be something like this:

    $("nextLink").click({
    ChangeImage();
    });
    $("prevLink").click({
    Idx -= 2;
    ChangeImage();
    });
    

    @canute: just as an <a> around the big image

    <a href="#">
    </a>
    

    The ImageSwitch still works this way.

    Thank for comments :)

    March 31st, 2009
    admin

    To make it autostart, just add this line of code in $(documnet).ready:

    StartSlideShow();

    April 1st, 2009
    canute

    thanks for the quick answer
    but the url question was about how i can make that the images that switch, have each one a diferent link? if the image switch, how can i switch the link?

    and i really dont get javascript
    so i apply the code and i cant make it autostart:

    $(document).ready:StartSlideShow();(function(){

    (i try the StarSlideShow(); in different places but no result)

    sorry for the incovenient

    April 1st, 2009
    admin

    Oh right, you’re new to JS. For autostart it should be

    $(document).ready(function(){
    StartSlideShow();
    });
    

    For switch the link, it should be:
    html:

    <a href='link1'> <img id='mainImg'  /></a>
    

    js:

    $('#mainImage').parent().attr('href','newlink');
    
    April 3rd, 2009

    Wow you are quick! The problem with your suggestion is that with js disabled the onclick won’t work. What I’m looking for is a solution similiar to easyslider – http://cssglobe.com/lab/easyslider1.5/02.html. With js off the images are stacked but I can set overflow: auto on the container so it doesn’t ruin my page design.

    April 3rd, 2009
    admin

    Hi, to make slider effect like this link, you should use a different method instead of imageswitch. I’m actually working on a new plugin call tabSwitch which could fix your problem. It’s still a work in progress but you could see the result so far at : http://www.hieu.co.uk/tabswitch/ . I’m trying to make a complete fully customizable tab system. It’s allow you to switch different kind of tabs, fix the problem when javascript turn off as well. Hopefully I could release it in next Monday.

    April 21st, 2009
    Seth

    Very nice and quite usefull one question though.

    How can we make the top navigation effect work like an actual navigation. EX: Images change on hover, links points to a differnet page?

    April 24th, 2009
    Christopher Vrooman

    Stumbled!

    May 6th, 2009

    I got the same question as Seth…
    I’d like the links work as a navigation and change the image just on mouseover.
    Now when I click on the Navi-link i get to the linked image…
    Any suggestions?
    Thanks

    May 8th, 2009

    Hi, I changed the example already, so now every buttons have different links. You could view the source code of the new version: http://www.hieu.co.uk/ImageSwitch/ImageSwitchSample/TopNav.htm

    May 9th, 2009
    Dirk

    thanks a lot!
    that really helped

    May 23rd, 2009
    Scott

    Slide show gallery [well done]

    Any plans or advice…

    scrolling row of thumbnails [one row when excessive number of images]

    horizontal
    scroll automatically when the mouse is hovering over a thumbnail and stop when the mouse stops hovering – left or right

    or vertical top / bottom

    May 30th, 2009
    Greg

    hello!!
    the scritp is awsome.
    can you help me?
    in the example of “My top navigation effect”
    If i have one image for “home”, and another image for “portfolio”, and another image for “archive” etc.

    how can i make when roll out the button, returns to the original image?, not the hover image, but one of my choice?

    thank you

    May 30th, 2009

    hi Greg, Here is the code to do what you want

    The first part is the same but I add the second parts so it move back to another image. Enjoy :)

    $(“#TabMenu a”).hover(function(e){
    $(“#ImgObject”).ImageStop(true,true);
    $(“#ImgObject”).ImageSwitch({ Type:”FadeIn”,
    NewImage:$(this).attr(“rel”),
    EffectOriginal: false,
    Speed: 500});
    e.preventDefault();
    },{
    $(“#ImgObject”).ImageStop(true,true);
    $(“#ImgObject”).ImageSwitch({ Type:”FadeIn”,
    NewImage:”Your original image link here”,
    EffectOriginal: false,
    Speed: 500});
    e.preventDefault();
    });

    June 13th, 2009
    Scott

    re: Slide show gallery with jQuery

    If you are not using the slide show option – how do you show the opening main image with its associated thumbnail. At the moment the main default image opens [on page opening] – but there is no indication as to what thumbnail it is related to – [thereafter when the user selects a thumbnail - all works as per your design] any chance of your solution

    June 19th, 2009
    steve

    This is great , Thank You !
    I have one strange problem though. I am using “Sequence of different effects”, and i managed to work with provided effects,with my one images… but if i try to use “FadeIn” instead of, for example ‘ScrollIn’, image fades, but then everything stops working.
    Any suggestion?
    Thanks in advance

    June 22nd, 2009

    Hi, I’m not so sure. If you could send me the script, I may work out the reason.

    August 1st, 2009
    Merrill

    Can you do a more detailed explanation on how to do a “next” and “previous” for the @Daz answer? Can’t seem to figure it out. Perhaps a demo page with these functions could be helpful? Thanks so much!

    August 7th, 2009
    Adrian Miller

    For those who want to give each imagein the Slideshow a href……..

    Put an <a href around the initial image in the DisplayDiv (in the example we’ll just link to the orginal image) and give it an id, for this example “Link”:

    [code]

    Then add
    [code]
    $("#Link").attr("href",$(".TnImage").eq(Idx).attr("src").replace("tn-","med-"));
    [/code]

    After the
    [code]
    $("#MainImage").ImageSwitch({NewImage: $(".TnImage").eq(Idx).attr("src").replace("tn-","med-")});
    [/code]

    To get this:
    [code]
    $("#MainImage").ImageSwitch({NewImage: $(".TnImage").eq(Idx).attr("src").replace("tn-","med-")});
    $("#Link").attr("href",$(".TnImage").eq(Idx).attr("src").replace("tn-","med-"));
    [/code]

    Of course you can manipulate the href to other than the demonstrated link back to the same image...

    August 7th, 2009
    Adrian Miller

    Sorry about the code tags in the last post…wasnt sure how to tag the code…

    And anyways, another tip….

    To opaque the first tumbnail so the user (and you) know that its the initial image diplayed, and so they dont click it and get confused…

    Add:
    $(“.TnImage”).eq(0).css(“opacity”,”1″);

    Under the

    $(document).ready(function(){

    line

    Happy script hacking…gotta love simple quick hacks :)

    August 7th, 2009
    Adrian Miller

    Sorry again, but im unable to edit my first post so ill recreate the info here, and avoid code tags…

    To give each displayed image a href:

    In the DisplayDiv section, wrap a <a href= tag around the existing line, like this, you have to set the first URL you wish to link to, because the ChangeImage function isnt fired of course until you click on another thumbnail:

    Next add the following line:

    $(”#Link”).attr(”href”,$(”.TnImage”).eq(Idx).attr(”src”).replace(”tn-”,”med-”));

    Under the line:

    $(”#MainImage”).ImageSwitch({NewImage: $(”.TnImage”).eq(Idx).attr(”src”).replace(”tn-”,”med-”)});

    And thats it

    August 7th, 2009
    Adrian Miller

    Oh, and if you want to get rid of the hyperlink border, add this to your css style:

    #Link img{
    border: 0;
    }

    September 7th, 2009

    nice effects

    September 7th, 2009

    plz help to download the code

    October 8th, 2009
    kris

    Indeed , Steve, i tried the FadeIn effect too on a list of images (for a kind of slideshow effect), but the counter “ImgIdx” stays on “2″.
    It doesn’t run the inner “function” where the index is raised by one (ImgIdx++), except for the first time. Strange !
    No problem however with any other effect like Scrollin our Scrollout. Only “FadeIn” doesn’t continue.
    Any idea, admin ?

    October 8th, 2009

    Hi Kris, there’s a few reason could lead to this. However, I suggest you could use the debug function of firebug to check it or easier send me the code file (if it’s in HTML) so I could check it for u. I did have the same problem before but it’s because of other script doesn’t work and stop the whole process, not imageSwitch error.

    But so far as I know, I didn’t hit any problems like that with FadeIn effect. So I have no clue at all :(

    @Steve, good to know you solve the problem.

    October 10th, 2009
    walterg

    Hi,
    I like ImageSwitch very much and use it for a slideshow. My images have a border and a padding. Now each time I change the image, it jumps the amount of the padding to the left. You can see it here:
    http://www.bilderreisen.net/nor-dias01.html
    Any idea how to solve the problem?
    Thanks,

    Walter

    October 11th, 2009

    Hi Walter,
    It’s quite simple to fix the problem. Because you sett the style for the image so ImageSwitch didn’t know to change the style for the effect image. To fix it, in your CSS write:
    .GrpEffectImg{
    border: 1px solid #000;
    padding: 4px;
    height: 343px;
    width: 510px;
    }
    .GrpEffectImg is the class for the effect image. Change it the way you want :)

    October 21st, 2009
    Asma

    Dear HieUK

    Honestly thank you so much for the resources you’re providing us with. Your work is just more than marvelous. Can you kindly help me with this

    Try it now – 3 lines of code for 9 different effects i can’t seem to sort it out. I tried uploading the images on the Internet so it loads directly when the images scroll in but no images are being displayed expect for the one loaded in the main frame, please help me :)

    Regards

    November 6th, 2009
    Matt

    Hi Hieu,

    This looks like a great plugin, thank you for your work on it.

    Is it possible to have the source for the image to be switched be pulled dynamically? What I am looking at is a thumbnail gallery of product fronts. When you click a thumbnail, a larger image on the page is switched out. There is an option to view the products back, but the source for this would need to change based on which thumbnail was just clicked.

    Thank you,
    Matt

    November 8th, 2009

    Hi Matt,

    It’s absolutely possible to do what u said but will require a lot more code(both server and client sides). It’s too complicate to just give a simple answer anyways. I made one similar as you said so you could take a look here: http://www.gardenbuildingsdirect.co.uk/Log-Cabins/BillyOh-Sportsman-Log-Cabin

    Click on the picture to enlarge the image and it uses imageSwitch for the effect. I can’t give you the code as it’s work property but you could just use firebug and read the code anyways.

    February 4th, 2010

    Hi HieuUK,
    I love the plugin you made and i am trying to incorporate it to my own slideshow. I created a button that when you click it will switch to the next image. However i have no clue how to code that. <a href = ( idont know because each image has a different name) how could i href the button to display every image? I suck at web design so, i have poor knowledge sorry if for the inconvenience but i do love your plugin and i would like to use it.

    Thank You,
    Fleech

    February 4th, 2010

    Also i don’t think this matters or not, but the images are all the same height but are not the same width? I think i should be ok though.

    February 4th, 2010

    Hi Fleech, to answer your question I have made an example of how to do it. You could follow it for your website.
    Click 2 Switch

    February 15th, 2010
    Morgan

    Thanks for these wonderful scripts!

    I really love your top Nav script and was wondering if it’s possible to make the the images in id=”SwitchImg” clickable so they can be assigned their own external link?

    February 15th, 2010
    Morgan

    These scripts are great. Thank you!

    I really love your Top Nav script and was wondering if it’s possible to make the the images in id=”SwitchImg” clickable so they can be assigned their own external link?

    February 19th, 2010
    TTN

    Great work!

    I am not skilled in JQuery and in JavaScript… as well!

    I would like to have the flip clock make a countdown.
    How much time (in days, hours and seconds) is to reach, I say, April 8th.

    Is it possible?

    I find a lot of countdown jQuery script but none has the smoothness of your transitions.

    Cheers
    TTN

    February 27th, 2010

    Awesome plugin! :)

    March 10th, 2010
    emailandthings

    awesome plug-in!

    Doesn’t work with jquery 1.4+ ( yet !)

    March 29th, 2010
    amir

    Hi,
    ImageSwitch is not functioning… i’ve tested it.. and it’s not working..

    April 3rd, 2010
    john

    This is the best image slider I have come across and I have been testing out dozens over the last 2 weeks. I have 1 question, is it possible to position text within the images without putting the text in the images themselves. I am trying to avoid having images with text in them, so when I need to change the text I do not need to change the image.

    I know I can use a content slider with background images and overlay the images with text, but ImageSwitch has such brilliant effects I really want to use it.

    Great work!

    April 16th, 2010
    Steven

    Hello
    This image slider looks exactly like what I need.

    I am having trouble getting it to do the FlipOut effect. I have copied your card flip example, but it just changes to the next image with no effect.

    In I.E. it also shows an error image, as if the image cannot be found( though the image does change so it is finding it) – so a bit odd :)

    You can see my example here :
    http://slattsauction.wrenware.net/dev/testimg.html

    thanks for your help !

    Cheers

    May 17th, 2010

    Having the same problem as steven, IE is creating extra divs with broken image links each time the image changes, firefox is fine, so i cant even use firebug to see what divs are being created, i hate IE so much!!!

    http://camerich.base5.eu/product.php?id_ctg=1&id_rng=1

    any ideas how to fix? i have worked an alternative using tabswitch, but is not ideal as i cant get the thumbnails to auto change with the slideshow.

    great plugins though am loving your work

    May 17th, 2010

    Hey Steven ive manages to fix the problem
    look in the commented imageswitch js
    line 66
    Obj.parent().append(“”);

    just comment out that line and it seems to fix the problem, don’t know why but it does and doesn’t seem to break anything.

    hope it works for you.

    May 17th, 2010

    ahh message didnt render properly!
    the bit in the ” ” should be img class=’GrpEffectImg’ id=’”+EffectImageId.replace(“#”,”")+”‘/ with each side

    May 18th, 2010

    not a great fix as it just switches the image and doesn’t fade one into the other, i think the problem is that ie does not remove the div correctly, any ideas on how to fix this Hieuuk???

    June 5th, 2010

    Set your life time more simple take the loans and all you require.

    June 22nd, 2010
    Anders

    Like this slider a lot but unfortunately it’s not compatible with jQuery 1.4.2. Any plans for an update?

    July 8th, 2010
    ARoper

    This is pure genius. Just what I was looking for. Thanks so much for your efforts.

    Trackbacks
    Trackback from: End of March | HieuUK
    March 31st, 2009
    Leave a Reply