Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[Solved] JQuery interaction question w/Vanilla embedded in wordpress

2»

Answers

  • peregrineperegrine MVP
    edited April 2012

    I know the event is firing and I've actually tried the animate before.

    But here is my result

    $("a.pagenavigatortop").click(function() {
    alert('fired');
     $('html, body').animate({scrollTop:0}, 100);
     return false;
     });
    

    non-embedded see alert then goes to top

    embedded see alert and doesn't go to top - just jitters 1/4 inch and is prevented from doing anything :)

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • fwiw - I think I found the problem - it is being overruled by remote.js in the embedvanilla plugin.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • 422422 Developer MVP

    Id clash?

    You must add the jquery to vanilla and not wormpress or external page.

    ie. Default.master.php or .tpl

    There was an error rendering this rich post.

  • no id clash, but url rewriting and page position and urls controlled by remote.js- if you look at the plugin and look and remote.js, as mentioned above, you will be enlightened! You will also note as I said before changing tpl doesn't fix it and you will also note the jquery is added in vanilla. I'll let you know if I ever solve it, or maybe Lincoln or Todd or whoever will explain the ins and out of remote.js. I'll either wait for them to respond or somebody who actually has solved it in the appropriate software.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • 422422 Developer MVP

    Why so complicated, all you wanna do is scroll to top from somewhere in your vanilla page. You cannot scroll to top if you are below the fold, within an iframe and you havent got scroll bars, the parent window will still remain in its position at whatever scroll position.

    Perhaps share a link, i am getting confused.

    There was an error rendering this rich post.

  • peregrineperegrine MVP
    edited April 2012

    I don't think you will be able to experience it without loading the pagenavigator-plugin and embedding it in wordpress. The code is in the plugin. The explanation remains the same it works perfectly when not embedded in wordpress.
    The top and bottom navigation do NOT work when embedded in wordpress. Drop the iframe from your thoughts, and then look at remote.js in the the embedded theme plugin to take a gander at the machinations. Once again - these are the variations
    ( http://vanillaforums.org/discussion/comment/157435#Comment_157435 ). I tried as well as x00's suggestion and your tpl suggestion.

    http://vanillaforums.org/addon/pagenavigator-plugin

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • 422422 Developer MVP

    Mate,

    Why would i go to ALL that effort...

    Setting up wormpress , vanilla, embedding, adding plugins ... Just to experience your issue ?

    Either post a link, screenshot or your on your own, at least with my assistance cos...

    Im farting into a tornado, here ! Lol

    There was an error rendering this rich post.

  • peregrineperegrine MVP
    edited April 2012

    Thanks for the help 422 - I appreciate you sticking with me.
    This works - http://vanillaforums.org/addon/pagenavigator-plugin
    You know the images are posted with the plugin, so you don't have to load the plugin to see what I am talking about.

    Solved. Browser specific Issue.It works (top and bottom) embedded and unembedded under google chrome. (doesn't work in firefox).

    Didn't occur to me that it could be a browser issue.

    Looks like you don't have to continue with the gas in a tornado. :).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • the ultimate solution in all versions and embedded and unembedded

    the solution was using a parent.window

    jQuery(document).ready(function($) {
    
    $('a.pntop').click(function() {
    parent.window.scrollTo(0, 0);
    return false;
    });
    
    $('a.pnbottom').click(function() {
    ht = $(document).height();
    parent.window.scrollTo(0, ht-200);
    return false;
    });
    
    });
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • 422422 Developer MVP

    Glad you sorted it, no idea how this gets marked as solved.

    There was an error rendering this rich post.

Sign In or Register to comment.