Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Make exception for some internal links in Chris ALL AJAX WordPress theme.

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #33820
    noahgelman
    Participant

    Some things like click events and lightbox’s don’t work since they are internal links. How can I make an exception for these things in regards to the ALL AJAX WordPress theme?

    #84594
    noahgelman
    Participant

    That doesn’t make any sense. Do you know what js the theme uses?

    #84595
    clokey2k
    Participant

    You could add a class to the links that you do not wish to be AJAX’d, and change the ‘allajax.js’ to include a ‘.not()’ statement?

    $('a:urlInternal').not('.myspeciallinks').live('click', function(e) { ... });

    ***EDIT*** I have also just read your other post: 13068.

    You’ve tried the ‘.not()’ function. No further ideas from me then! :-)

    I believe the issue @BoringCode is trying to address is already dealt with by the ‘.live’ function. The only time that you would need to readdress ‘click’ functions is if there is an ‘iframe’ in the lightbox.

    #84597
    noahgelman
    Participant

    @clokey2k, that was something I tried, without success. I tried a few things along side that.

    I did however find out the problem.

    I found this article by Chris: https://css-tricks.com/9738-just-one-of-those-things-you-need-to-understand-about-javascript/

    I now know what BoringCode was trying to say and I want to apologize for being a bit rude to him. When he said I needed to initialize the click in the AJAX call he really meant I needed to RE-initialize the click function so I misinterpreted what he was trying to say.

    That being said, I thought I had been reinitializing it. I tried using .live() and .delegate() to re-establish the clicks as well and neither worked. For whatever reason I had to recall the entire function that sets up the gallery. I suppose there’s important code that needs the DOM already set before calling it so just replacing the clicking wasn’t enough.

    Thanks for the help BoringCode and clokey2k.

    Sorry again BoringCode

    #92855
    safetyjon
    Member

    noah-
    i’m running into a similar problem with using jquery with the allajax theme, thought you might be able to elaborate on your solution.

    i’ve implemented a slideshow on individual pages and it works if i hit the url exactly (www.site.com/pagetitle), but the jquery bits arent happy with the ajax’d url (www.site.com/#/pagetitle).

    can you provide a bit more detail into how you recalled the js function?

    thanks!
    jon

    #92869
    noahgelman
    Participant

    Sure, no problem. I added the links to the ‘removed list’ (like in clokey’s example) and then I the changed all the initiallizing clicks in me plugin’s code from:


    $("a").click(function(e) {

    to

    $("a").live('click', function(e) {

    and that fixed the issue. If you post your code or tell me what slider you’re using I can give a more detailed answer on how to fix your code to work with AJAX

    #92871
    safetyjon
    Member

    after pondering a bit more, the issue seems related but the cause might be different. i’m using the Image Slider plugin from TheThe Fly.

    here’s a screenshot of what’s happening. the slideshow window div is created and appears, but the loading bar stays persistent. and, as you can see, the thumbnails are displaying correctly, though there’s no click action.

    if i remove the ajax functionality entirely, the slideshow works exactly as intended. so, it’s definitely a related issue, but not quite the same.

    jon

    #92932
    noahgelman
    Participant

    hmmm, I see. same kind of issue, different cause.

    Can you post a link?

    #92955
    safetyjon
    Member

    here’s the link to a test setup. currently, the only page that has the TheThe Fly Image Slider loaded into it is the “photographers” page. as you can see, if you hit http://awesomesnack.com/photographers/ directly, the slideshow works as expected. if you go the root url and click on the photographers link, you get the spins.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.