Jump to content

Image gallery Jquery help ?


Skylight_lady

Recommended Posts

Hi Guys, here is a jquery/ajax code whichever it is. I took this from a website as it's gallery looked good and different to the rest. It's jquery code is listed below:

 

typeof(myscript)!="object"&&(myscript={});
myscript.galleryPromo=function(){
$(".enable-gallerypromo").each(function(f){
	var d=$(this).attr("data-options");
	var a={el:$(this),imagepath:myscript.util.getoptions({opts:d,val:"imagepath"}),type:myscript.util.getoptions({opts:d,val:"type",def:"hover"}),length:$(this).find(".gallery-thumbs li").length,thickbox:myscript.util.getoptions({opts:d,val:"thickbox"})};
	var h=0;
	var e=0;
	var c=false;
	var b=$(".gallery-thumbs");
	var g=$(".gallery-thumbs li").length-1;
	if(a.length>0){
		b.before('<ul class="gallery-pic"></ul>\n');
		$("li",b).eq(0).addClass("on").end().mouseover(function(){if(c){var k=$(this).index();
		$(".gallery-thumbs li, .gallery-pic li").removeClass("on");
		$(this).addClass("on");
		$(".gallery-pic li").eq(k).addClass("on")}}).each(function(n){$(".gallery-pic").append("<li></li>");
		var m=$(this).find("a").attr("href");
		var l=new Image();
		var k=$(this).find("a").attr("rel");
		var o=$(this).find("img").attr("src");
		var q=o.split("/");
		var p=$(this).find("a").attr("title");
		q[5]=a.imagepath;
		o=q.join("/");
		$(l).bind("load",function(s){$(".gallery-pic li").eq(n).append('<a href="'+m+'" class="image-'+n+'" ><img src="'+o+'" alt="'+p+'" /><div class="gallery-details"><h4>'+p+'</h4><p class="gallery-count">'+k+"</p></div></a>");
		if(n==g){
			c=true;
			$(".gallery-pic").find("li:first-child").addClass("on")}}).error(function(){}).attr("src",o)})}})};

 

How do i change this to make the image path as my desired location? If you need more information please let me know and i can provide this or an address to their website if desired. I just couldn't figure out how they are getting these images to show.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.