/////////////////////////////////////////////////////////////////////à // jQuery Horizontal Slider Plugin // // Version 1.0 // // Yusuf Najmuddin // 4/20/2011 // // TERMS OF USE // // This plugin is dual-licensed under the GNU General Public License and the MIT License and // is copyright 2011 Yusuf Najmuddin http://ynzi.com // window.onload = function(){ //***** slider ***** var items, width, it, next=0, t, td, tc, args = {interval: 9000, animation: 1300}; function slide(i){if (i==0){$(td).animate({'left':0}, 0);}else{$(td).animate({'left':-1 * i * width}, args.animation);}}; function showdot(i){$(tc).find('a').removeClass('active');$(tc).find('a:nth-child('+(i+1)+')').addClass('active');}; function show(i) {i = i * 1; clearInterval(it); showdot(i); slide(i); it = setInterval(function(){ i++; if (i==items) i=0; showdot(i); slide(i); }, args.interval); }; $.fn.hslide = function(o){ $.extend(args, o); t = this; $(t).css({position: 'relative', overflow: 'hidden', visibility: ''}); width = $(this).width(); height = $(this).height(); items = $(this).children('div').length; $(t).children('div').wrapAll('
'); td = $(this).children('div').first().css({position:'absolute', width: width * items}); $(td).children('div').css({width: width, height: height, overflow:'hidden', 'float': 'left', padding: 0, margin: 0}); tc = $('').prependTo(t).css({position: 'absolute',right:'440px',bottom:'40px','z-index':1000}); for (var j=0;j< items ;j++ ){ $('').click(function(){ show($(this).attr('rel')); }).appendTo(tc); } $(tc).find('a').css({cursor:'pointer','float':'left'}); show(0); }; //***** news ***** tempo_cambio=900; ritardo=5000;arj_titoli=new Array();arj_descr=new Array();arj_link=new Array();arj_immagini=new Array(); numero_elementi=0; elemento_attuale=0 $.ajax({ url: "genera-news.asp", success: function(informazioni){ $(informazioni).find("elemento").slice(0,5).each(function(){ arj_titoli[numero_elementi]=$(this).find("titolo").text(); arj_descr[numero_elementi]=$(this).find("descrizione").text(); arj_link[numero_elementi]=$(this).find("link").text(); arj_immagini[numero_elementi]=$(this).find("img").text(); numero_elementi++; }); $.fn.preload = function() {this.each(function(){$('')[0].src = this;});};$(arj_immagini).preload(); funzione_cambio(); } }); function funzione_cambio(){ $("#elemento_news_link").html("