I'm sorry! My english isn't good.
I'm beginner in JavaScript, and jQuery.
I have made a fadeshow. It works perfectly, but i'd like to make pagination for this slideshow and I don't know, how sould I solve it.
I don't want to generate the pagination with javascipt. Because I'm going to generate the pagination with php, because the required data (menu name, menu id ect) is in database.
I have got menu links with these ID-s: link_1, link_2, link_3 ect.
Here is the code:
On my website the menu links are after the fadeshow. I want to do, if I click on a menu link the fadeshow jump to the relevant image of the link with fade effect. if I click the link the new content load after the menu in a container div.Code:<!-- $(document).ready(function(){ var windowWidth = $(window).width(); var windowHeight = $(window).height(); // slideshow begin var slideTime = 5000; // slide time param var fadeTime = 1000; // fade time param titlePosition(); slide(); function slide(){ setTimeout(slideshow, slideTime); $('.active_image').parent('div').fadeIn(fadeTime); } function slideshow(){ actualImage = $('.active_image').parent().attr('id'); actualImageNumber = actualImage.split('_'); nextImageNumber = parseInt(actualImageNumber[1]) + 1; nextImage = actualImageNumber[0] + '_' + nextImageNumber; $('.active_image').parent('div').fadeOut(fadeTime); $('#slider img').removeAttr('class'); if ($('#'+nextImage).length > 0){ $('#'+nextImage).children('img').addClass('active_image'); } else{ $('#slide_1').children('img').addClass('active_image'); } slide(); } //slideshow end $('nav a').live('click', function(){ url = 'includes/'+$(this).attr('href'); if (url == 'includes/index.php'){ url = 'includes/fooldal.php'; } $('nav li').removeClass('nav_active'); $(this).parent().parent().addClass('nav_active'); if ($('#loading').length<=0){ $('body').append('<div id="loading"><img src="images/pictures/loading.gif" alt="Betöltés" title="Betöltés"></div>'); $('#loading').css('height', windowHeight); $('#loading img').css('margin-top', windowHeight/2-32); $('#loading img').css('margin-left', windowWidth/2-32); } $('#article').load(url), function(){ }; return false; }); $(window).resize(function() { titlePosition(); var windowWidth = $(window).width(); var windowHeight = $(window).height(); $('#loading').css('height', windowHeight); $('#loading img').css('margin-top', windowHeight/2-32); $('#loading img').css('margin-left', windowWidth/2-32); }); function titlePosition(){ $('#title').prependTo($('article')); } }); -->
Please help me!
Thank you
Kissgy1028


Reply With Quote

Bookmarks