Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Javascript Conflict

Featured Replies

Hello Everyone,

 

I am adding 2 effects in one page, say, header transition and scroller in footer.

 

But only one is working at a time.

 

here is the link:

 

http://www.rajanskumar.com/jsclash/header.html

 

In this link, scroller is working. but if i move the

 

 

<script type="text/javascript" src="js/slide.js"></script>

 

above

 

<script type="text/javascript" src="js/jquery-1.6.3.min.js"></script>

 

then scroller stops working and header starts working.

 

Not getting whats the problem.

 

Any Help..!

Hi,

 

You have to make some changes into JS

 

Slide.js

 

Remove all old code and replace with below code.

$(function() {
 $(".slider_container").jCarouselLite({
	 btnNext: ".arrow_right",
	 btnPrev: ".arrow_left",
	 visible: 2,
speed :1000,
auto : 10
 });
});

 

Hope this will works :)

Edited by Hem

jQuery MUST be loaded before any other jquery plugins, since slider uses jquery, slide.js must be below jquery .

 

as for your error, everything works good if you do this, open header.js and add this to the top :

var $ = jQuery.noConflict();

 

another method is to open header.js and replace $ with jQuery .

both methods works, but I would go with the second one.

also don't try using the code Hem mentioned, he has missed something.

 

@hem,

the code you have given is inside this file , hence there is no need to add it !

Edited by Danny87

jQuery MUST be loaded before any other jquery plugins, since slider uses jquery, slide.js must be below jquery .

 

as for your error, everything works good if you do this, open header.js and add this to the top :

var $ = jQuery.noConflict();

 

another method is to open header.js and replace $ with jQuery .

both methods works, but I would go with the second one.

also don't try using the code Hem mentioned, he has missed something.

 

@hem,

the code you have given is inside this file , hence there is no need to add it !

 

Yes I'm agree with you Danny but I've replaced $ to avoid jQuery Conflict. What I missed? Can you tell me? I've run this code in my local PC. It's working fine from my side.

Edited by Hem

Welcome. Rajanskumar, Could you please edit your first thread & Marked as [sOLVED].

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.