Results 1 to 4 of 4

Thread: Problem with jquery .load()

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

    Default Problem with jquery .load()

    Hi everyone! Im new here and this is my first post!

    I'm playing around with the dynamicdrive animatedcollapse jquery plugin and I'll have to tell you i'm not a javascript expert so therefore i seek help here.

    I use the script on a site and within the DIV's that the script show or collapse i'd like to use $('#target').load('page.html');. It works fine but however when i've clicked on a link that does this the animatedcollapse script stops working and I can't click any animatedcollapse links. Or i can click on them but nothing happens.

    Is there a way to get around this problem? Is there a collision between animatedcollapse and the .load() command?

    Best Regards
    Paparappa

    Edit: I just realised i might have posted this in the wrong forum. Im sorry for that and a moderator can maybe move this?

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

    Default

    Or is it maybe possible to load external content with the animated collapse script? I mean can the script load page.html on click in an animated collapse div? http://www.dynamicdrive.com/dynamici...edcollapse.htm

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Just to confirm, you're trying to use jQuery's load() function to load a new page content into one of the collapsible DIVs right? For example:

    Code:
    <div id="jason" style="width: 300px; background: #FFFFCC; display:none">
    <b>Content inside DIV!</b><br />
    <b>Note: Fade effect enabled. Height programmically defined. DIV hidden using inline CSS.</b><br />
    </div>
    
    
    <p><a href="#" onClick="javascript:jQuery('#jason').load('test.htm')">load test.htm into DIV "jason"</a><p>
    Here the "jason" DIV is one of the collapsible DIVs, and the link that follows when clicked on loads "test.htm" into it. If this is what you're trying to do, the script should still animate the "jason" DIV just fine (expand or collapse it), provided you make a small tweak to the .js file to ensure the height of the animated DIVs are no longer cached. Inside the .js file, find the below line:

    Code:
    this.$divref.css(ac.generatemap(['height', this.getAttr('height')], ['display', cssdisplay]))
    and change that to:

    Code:
    this.$divref.css(ac.generatemap(['display', cssdisplay]))
    DD Admin

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

    Default

    Thank you Admin!

    I think that does it!

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
  •