Created
February 8, 2012 11:17
-
-
Save scopevale/1768251 to your computer and use it in GitHub Desktop.
Prototype jQuery noConflict test - 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div { | |
display: none; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="jQueryButton1">jQuery Button 1</button> | |
<button id="ProtoButton1">Prototype Button 1</button> | |
<div id="jQueryDiv1">This is displayed using Prototype - click me</div> | |
<div id="ProtoDiv1">This is displayed using Prototype</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global $: true, window: true, base_url: true, show_shift_division: true, jQuery: true, document: true, sprintf: true, alert: true, console: true, plotGraph: true*/ | |
Event.observe(window, 'load', function(ev) { | |
$('ProtoButton1').observe('click', function(ev) { $('ProtoDiv1').show(); return false; }); | |
$('jQueryButton1').observe('click', function(ev) { $('jQueryDiv1').show(); return false; }); | |
}); | |
jQuery.noConflict(true)(function(jQ) { | |
jQ('#jQueryDiv1').bind('click', function(ev) { | |
jQ('#jQueryButton1').unbind('click'); | |
$(this).html('This is NOW displayed using jQuery'); | |
jQ('#jQueryButton1').bind('click', function(ev) { | |
jQ('#jQueryDiv1').toggle(); | |
}); | |
console.log('clicked #jQueryDiv1'); | |
return false; | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: jsFiddle/Gist demo - Prototype jQuery noConflict() | |
description: jsFiddle demo hosted on Gist using Prototype & jQuery/jQueryUI | |
authors: | |
- Gary Smith | |
title: | |
- JS Fiddle - Prototype jQuery noConflict() | |
resources: | |
- /js/empty.js | |
- https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js | |
- https://ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js | |
- https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js | |
- http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/start/jquery-ui.css | |
- https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js | |
- https://getfirebug.com/firebug-lite-debug.js | |
normalize_css: yes | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://jsfiddle.net/gh/gist/library/pure/1768251/