/    Sign up×
Community /Pin to ProfileBookmark

Javascript Colliding

Hi,

My knowledge of javascript is very minimal and I am trying to put a picture slideshow in along with my navigation bar calls some javascript. When one code is active the other doesn’t work and vice versa. What in the world is causing the conflict?

This is the small script located in the html page:

[code=html]<script type=”text/javascript”>
$(document).ready(function(){

$(“ul.subnav”).parent().append(“<span></span>”); //Only shows drop down trigger when js is enabled – Adds empty span tag after ul.subnav

$(“ul.topnav li span”).click(function() { //When trigger is clicked…

//Following events are applied to the subnav itself (moving subnav up and down)
$(this).parent().find(“ul.subnav”).slideDown(‘fast’).show(); //Drop down the subnav on click

$(this).parent().hover(function() {
}, function(){
$(this).parent().find(“ul.subnav”).slideUp(‘slow’); //When the mouse hovers out of the subnav, move it back up
});

//Following events are applied to the trigger (Hover events for the trigger)
}).hover(function() {
$(this).addClass(“subhover”); //On hover over, add class “subhover”
}, function(){ //On Hover Out
$(this).removeClass(“subhover”); //On hover out, remove class “subhover”
});

});
</script>[/code]

The other js file is located here: [URL=”http://thelocallister.com/NEW/slider/scripts/mootools-1.2.1-core-yc.js”]http://thelocallister.com/NEW/slider/scripts/mootools-1.2.1-core-yc.js[/URL]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @landzir101 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...