« Return to Thread: superfish and Lokesh Dhakar's lightbox2 seem to conflict - please help
Re: superfish and Lokesh Dhakar's lightbox2 seem to conflict - please help
gone too far, only place the $ needs changing is in the script tag you
use to call menu and create functions based on jquery.js or plugins.
The plugins are safely contained in special function wrappers. For now
just consider plugin files as read only, and library files are always
read only
you've placed noConflict properly within the script tag with document .ready, however I would follow the instructions on placement of script files a little closer.
Your prototype call of // Use Prototype with $(...), etc.
$('someid').hide();
is above the prototype library so that is already throwing an error that "$ is not a function"
best to just get a clean copy of superfish.js and replace the one you modified. The visuals are CSS related I'm fairly sure. The current class isn't being applied correctly, it's showing up on <a> tags, look at markup on superfish website for navbar example and tags that have current class applied, compare to yours.
Also, sf-menu is floated right, no float applied on original superfish, not sure if that is a problem but since you're having problems I'd get rid of it, maybe use margin, or float a container instead
My suggestion is start over. Clean CSS file, clean markup, clean js file. Also kill the other scripts one at a time, see what happens
JayD wrote:
you've placed noConflict properly within the script tag with document .ready, however I would follow the instructions on placement of script files a little closer.
Your prototype call of // Use Prototype with $(...), etc.
$('someid').hide();
is above the prototype library so that is already throwing an error that "$ is not a function"
best to just get a clean copy of superfish.js and replace the one you modified. The visuals are CSS related I'm fairly sure. The current class isn't being applied correctly, it's showing up on <a> tags, look at markup on superfish website for navbar example and tags that have current class applied, compare to yours.
Also, sf-menu is floated right, no float applied on original superfish, not sure if that is a problem but since you're having problems I'd get rid of it, maybe use margin, or float a container instead
My suggestion is start over. Clean CSS file, clean markup, clean js file. Also kill the other scripts one at a time, see what happens
JayD wrote:
Thanks Charlie, Greatly appreciate your assistance with this. Unfortunately however still no joy... I'd prefer to continue using the Prototype version of Lightbox and I've now been informed by other team members that I must so am really keen to get Superfish and Lightbox2 working properly independent of one another on this and similar pages. Have had a go at implementing jQuery.noConflict(); and you'll be able to see how I've gone about doing this within the head section of the same page as before http://www.the2jays.com/news/papua-new-guinea001.php . Not sure if I followed your instructions to a tee though: I added what I thought to be the correct jQuery.noConflict(); code to the existing Superfish script tag within the page head. I then proceeded to change/ swap out (used Dreamweaver's 'find and replace') every instance of '$' in the two external javascript files related to Superfish - superfish.js & hoverIntent.js . I've not made any changes to the jquery-1.2.6.min.js file contents. I was assuming this is what you meant by, "[...] then you have to change all "$" used for jQuery functions to "jQuery"." The reference/ call to the external prototype.js remains positioned under the above script tag mentioned above. On the remote website the initial problem still remains so I'm assuming I've not properly implemented the jQuery.noConflict(); I've been searching the web for a beginners/ n00b step by step tutorial on how to properly implement jQuery.noConflict(); but yet to find one so thought I'd post again here . Thanks again, JayD On Jul 3, 4:38 am, Charlie charlie...@... wrote:was trying to look at the navbar and didn't see protoype script there one problem is you have 2 versions of jquery.js loading, one with each plugin. That can cause problems. Keep the top one, delete bottom one. See if that helps. If menu problem persists seeing a version with no other scripts running might help if you use prototye put the jQuery.noConflict() right at beginning of the script tag with $(document).ready and place it before $(document).ready, then you have to change all "$" used for jQuery functions to "jQuery". JayD wrote:Hi, Firstly, really likeSuperfish! Also should mention I'm a complete noob when it comes to JavaScript code. Have successfully implemented the out-of-the-boxSuperfishnav-bar style within this website though - it's temporarily located herehttp://www.the2jays.com/index.php(note this site is still very much under construction, styling is still yet to be done (including the nav bar) and the site-wide build is only partially uploaded to the remote server). The site is a partial rebuild/ redesign and the old site used Lokesh Dhakar's lightbox2 on a number of pages (page contents on the new site are to remain the same as the old). On pages that reference the lightbox2 script (using 'Prototype JavaScript framework - version 1.4.0') a slight conflict with the desired rendering of theSuperfishnav-bar seems to occur - example pagehttp://www.the2jays.com/news/papua-new-guinea001.phpLightbox2 seems to still work fine and so doesSuperfishmostly, however the ‘PHP if statem ent’ generating the ‘current class tab’ on the top level 'News' button is lost/ missing and the second tier level button row has greater space between it and the top level than desired (while on this page mouse-over a different top level button to see what I mean). Hope the above makes sense. When I turn off <script type="text/javascript" src="../js/ prototype.js"></script> in the head section of the pageSuperfishappears perfect so I'm assuming it's got something to do with the ‘prototype’ framework ? I've looked at 'jQuery with Other Libraries' but as a noob this is over-my-head atmhttp://docs.jquery.com/Using_jQuery_with_Other_Librariesand to be honest I'm not sure if I'm on the right track. Did also try turning 'Lokesh Dhakar's lightbox2' off and used 'jQueryLightbox0.5' instead thinking the two jQuery scripts should work together. The same problem still occurred however. Anyway, thought at this point I should probably post here an d see if someone can assist me. Thanks in advance. JayD
« Return to Thread: superfish and Lokesh Dhakar's lightbox2 seem to conflict - please help
| Free embeddable forum powered by Nabble | Forum Help |