Results 1 to 4 of 4

Thread: Checking if variables are pointing to same object

  1. #1
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Checking if variables are pointing to same object

    Hi, i modified the Horizontal Accordeon (http://www.dynamicdrive.com/dynamici...haccordion.htm) a bit (disabled mouseover and added ability to contract items after expanding them):


    (only the blue line was put on a different place, everything else is original exept of the mouseover-effects being disabled)
    Code:
    	expandli:function(accordionid, targetli){
    		var config=haccordion.accordioninfo[accordionid]
    		var $targetli=(typeof targetli=="number")? config.$targetlis.eq(targetli) : (typeof targetli=="string")? jQuery('#'+targetli) : jQuery(targetli)
    		$targetli.stop().animate({width:$targetli.data('hpaneloffsetw')}, config.speed)  //expand current content
    		if (typeof config.$lastexpanded!="undefined") //targetli may be an index, ID string, or DOM reference to LI 
    			   config.$lastexpanded.stop().animate({width:config.paneldimensions.peekw}, config.speed) //contract last opened content
    		config.$lastexpanded=$targetli
    	},
    Problem is, that after expanding and contracting one item, it cant be expanded again (only if you expand another item before). Guess its because config.$lastexpanded and $targetli are pointing to the same item and the effects are revoking each other. How to check that with javascript?


    Thanks for the help!

  2. #2
    Join Date
    Aug 2004
    Posts
    9,893
    Thanks
    3
    Thanked 966 Times in 954 Posts
    Blog Entries
    15

    Default

    Hmm do you have a URL to the changed script we can check out, just to get a clearer picture of the issue?
    DD Admin

  3. #3
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    http://fhweb.bplaced.net/sites/test/

    Click 3 times on one item and it won't work again

  4. #4
    Join Date
    Mar 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No idea? thought it would be just an missing if-clause to fix that problem.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •