Please help modify my small script
Hi! I'm trying to modify my code but I'm new to Javascript and I need some help to figure it out.
When the page is fully loaded for the first time, click on the first tab (profile) and you'll see the problem.
This is the code:
- $(window).load(function(){
-
- $('#page2').delay(200);
- $('#page2').show('slow');
-
- $('#content>dd').css({display:'block'})
-
- $('#thumbs').jScrollPane({
- showArrows:false,
- scrollbarWidth:28,
- dragMaxHeight:82,
- })
-
- $('#thumbs li a').live('click',function(){
- $('#pic').attr('src',$(this).attr('href')).bind('load',function(){
- $(this).css({opacity:0}).stop().animate({opacity:1})
- })
- return false
- }).each(function(){
- var tmp=new Image()
- tmp.src=this.href
- })
-
- $('#content>dd').css({display:'none'})
- })
- $(function(){
- $('#content:not(.nav_block)>dt:not(.active) a,footer .privacy:not(.active) a[rel=privacy]').live('click',function(){
- var next=this.rel=='privacy'?
- $('#privacy'):$(this).parent().next(),
- width=next.width(),
- parent=next.parent(),
- visible=parent.find('>dd:visible').css({overflow:'hidden'})
- parent.addClass('nav_block')
-
- $('#content>dt,.privacy').removeClass('active')
-
- $(this).parent().addClass('active')
-
- if(this.rel=='privacy')
- $('#content>dt>a').removeClass('active').animate({opacity:0})
-
- if(parent.css('left')!=0)
- next.parent().animate({left:0})
- next.show().css({width:'64px'}).stop().animate({width:width+'px'},{
- step:visible.length?function(now){
- visible.width(width-now)
- }:'',complete:function(){
- next.css({overflow:'visible'})
- visible.css({width:width+'px'}).hide()
- parent.removeClass('nav_block')
- }})
- return false
- })
-
- $('.active a,#content.nav_block').live('click',function(){
- return false
- })