SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: jQuery Issue

  1. #1
    SitePoint Zealot w1nk5's Avatar
    Join Date
    Aug 2009
    Location
    Ontario, Canada
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery Issue

    http://174.121.35.250/~grosman/

    If you goto the link above and click "SEARCH LISTINGS" at the top and leave all the fields blank and then click Search it will display the search results.

    If you hover over the results, you will see a translucent div slide down with a magnifying glass. This is the desired effect.

    However, if you change the sorting or goto page 2... the sliding effect no longer works.

    Any ideas as to what is going on here?

    Thanks

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,200
    Mentioned
    105 Post(s)
    Tagged
    1 Thread(s)
    That's because jQuery will only "hook" the first time through, so when you reload the div through ajax, the hooks get lost. What you'll need to do is add an additional call to your jQuery code which will reapply the overlays (the property grid code in grosman-wagman/js/script.js) when you change the content of the div.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by DaveMaxwell View Post
    That's because jQuery will only "hook" the first time through, so when you reload the div through ajax, the hooks get lost. What you'll need to do is add an additional call to your jQuery code which will reapply the overlays (the property grid code in grosman-wagman/js/script.js) when you change the content of the div.
    Instead of that, you can use .live() so that whenever jQuery is used to adjust the content of the page, it will apply that event to any new or updated elements that are on the page.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  4. #4
    SitePoint Zealot w1nk5's Avatar
    Join Date
    Aug 2009
    Location
    Ontario, Canada
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    Instead of that, you can use .live() so that whenever jQuery is used to adjust the content of the page, it will apply that event to any new or updated elements that are on the page.
    That worked! Thanks a ton.


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
  •