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.

Jquery & Mootools conflict

Featured Replies

Hi,

I use both jquey plugin and mootools plugin in a web page so they conflict each other and my mootools plugin does not work. I read sporadic about jQuery.noConflict(); but I don't know how to use it in my script. could you please give me final code integrated with jQuery.noConflict(); ?

 

this is the script :

 

var jkpanel={
   controltext: 'panel',
   $mainpanel: null, contentdivheight: 0,

   openclose:function($, speed){
       this.$mainpanel.stop() //stop any animation
       if (this.$mainpanel.attr('openstate')=='closed')
           this.$mainpanel.animate({top: 0}, speed).attr({openstate: 'open'})
       else
           this.$mainpanel.animate({top: -this.contentdivheight+'px'}, speed).attr({openstate: 'closed'})
   },

   init:function(file, height, speed){
       jQuery(document).ready(function($){
           jkpanel.$mainpanel=$('<div id="dropdownpanel"><div class="contentdiv"></div><div class="control">'+jkpanel.controltext+'</div></div>').prependTo('body')
           var $contentdiv=jkpanel.$mainpanel.find('.contentdiv')
           var $controldiv=jkpanel.$mainpanel.find('.control').css({cursor: 'wait'})
           $contentdiv.load(file, '', function($){
                   var heightattr=isNaN(parseInt(height))? 'auto' : parseInt(height)+'px'
                   $contentdiv.css({height: heightattr})
                   jkpanel.contentdivheight=parseInt($contentdiv.get(0).offsetHeight)
                   jkpanel.$mainpanel.css({top:-jkpanel.contentdivheight+'px', visibility:'visible'}).attr('openstate', 'closed')
                   $controldiv.css({cursor:'hand', cursor:'pointer'})
           })
           jkpanel.$mainpanel.click(function(){jkpanel.openclose($, speed)})        
       })
   }
}

//Initialize script: jkpanel.init('path_to_content_file', 'height of content DIV in px', animation_duration)
jkpanel.init('index.htm', '80px', 1000)  

 

Thank you :give_rose:

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.