Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- var end = <?=$total_images?>;
- var imgWrapper = $('#propgallery > img');
- imgWrapper.hide().filter(':first').show();
- $(".prev").removeAttr('href');
- $(".prev > img").attr('src','Images/photo_left_disable.png');
- if(end==1){
- $(".next").removeAttr('href');
- $(".next > img").attr('src','Images/photo_right_disable.png');
- }
- $('#counter').html( "1/"+end );
- var caption = $('img#1').attr('name');
- $('.caption').html(caption);
- $('#propgalnav a').click(function () {
- if(end!=1){
- if(this.hash=="#prev"){
- count = parseInt($(this).attr('id')) - 1;
- }else if(this.hash=="#next"){
- count = parseInt($(this).attr('id')) + 1;
- }
- $('.prev').attr("id", count);
- $('.next').attr("id", count);
- $(".prev").attr ('href', '#prev');
- $(".next").attr ('href', '#next');
- i = "#" + count;
- if(count==1){
- $(".prev").removeAttr('href');
- $(".prev > img").attr('src','Images/photo_left_disable.png');
- }else if(count==end){
- $(".next").removeAttr('href');
- $(".next > img").attr('src','Images/photo_right_disable.png');
- }else if(count>1 && count<end){
- $(".prev").css('display','block');
- $(".next").css('display','block');
- $(".prev > img").attr('src','Images/photo_left.png');
- $(".next > img").attr('src','Images/photo_right.png');
- }
- var caption = $('img'+i).attr('name');
- $('#counter').html( count+"/"+end );
- imgWrapper.hide();
- $('#propgallery > img').filter(i).fadeIn(500);
- $('.caption').html(caption);
- }
- return false;
- });
Add Comment
Please, Sign In to add comment