SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2011
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation jQuery Lavalamp with Ajax Navigation

    Lavalamp should set current page as selected, but most of the time this does not work.

    I'm also using ajax navigation, so that might be the problem.

    Can someone take a look at my site and tell me what's wrong?

    Thanks.

    SpatialVoid :: Premium Custom Designing

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    The return false part of the ajax loader prevents the lavalamp from also capturing the event, so instead, tell the event to prevent the default action. That will prevent the web browser from following the link, but allow the click event to continue bubbling up through the DOM to where lavalamp can also capture it.

    Code javascript:
    $(c).click(function(evt) {
        AjaxContent.getContent(this.href);
        evt.preventDefault();
    });
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2011
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, loved ur answer


Tags for this Thread

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
  •