Skip to content

Commit

Permalink
bookmarklet now respects overflow-y
Browse files Browse the repository at this point in the history
  • Loading branch information
thomd committed Apr 4, 2011
1 parent 076d05f commit 32f9680
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions bookmarklet.html
Expand Up @@ -24,7 +24,7 @@ <h1>jquery-scroll testing bookmarklet</h1>
</header>
<section>
<p>This bookmarklet enables you to test the unobtrusive jquery-scroll plugin on your webpage before implementing it. The scrollbar of all elements with an overflow of <em>auto</em> or <em>scroll</em> will be replaced with a custom scrollbar.</p>
<p class="bookmarklet">Drag this link to your Bookmarks Bar : <a href="javascript:(function(){if(typeof%20jQuery==%22undefined%22){var%20c=typeof%20$==%22function%22;a(function(){if(c){jQuery.noConflict()}b()})}else{b()}function%20b(){jQuery(%22<link>%22).attr({type:%22text/css%22,rel:%22stylesheet%22,href:%22https://github.com/thomd/jquery-scroll/raw/master/css/scrollbar.css%22}).appendTo(%22head%22);jQuery.getScript(%22https://github.com/thomd/jquery-scroll/raw/master/jquery.scroll.js%22,function(){jQuery(%22*%22).filter(function(){return%20jQuery(this).css(%22overflow%22).match(/auto|scroll/)}).scrollbar()})}function%20a(f){var%20e=document.createElement(%22script%22);e.src=%22http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js%22;var%20d=false;e.onload=e.onreadystatechange=function(){if(!d&&(!this.readyState||this.readyState==%22loaded%22||this.readyState==%22complete%22)){d=true;f()}};document.getElementsByTagName(%22head%22)[0].appendChild(e)}})();">jquery-scroll testing</a></p>
<p class="bookmarklet">Drag this link to your Bookmarks Bar : <a href="javascript:(function(){if(typeof%20jQuery==%22undefined%22){var%20c=typeof%20$==%22function%22;a(function(){if(c){jQuery.noConflict()}b()})}else{b()}function%20b(){jQuery(%22<link>%22).attr({type:%22text/css%22,rel:%22stylesheet%22,href:%22https://github.com/thomd/jquery-scroll/raw/master/css/scrollbar.css%22}).appendTo(%22head%22);jQuery.getScript(%22https://github.com/thomd/jquery-scroll/raw/master/jquery.scroll.js%22,function(){jQuery(%22*%22).filter(function(){return%20jQuery(this).css(%22overflow%22).match(/auto|scroll/)||jQuery(this).css(%22overflow-y%22).match(/auto|scroll/)}).scrollbar()})}function%20a(f){var%20e=document.createElement(%22script%22);e.src=%22http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js%22;var%20d=false;e.onload=e.onreadystatechange=function(){if(!d&&(!this.readyState||this.readyState==%22loaded%22||this.readyState==%22complete%22)){d=true;f()}};document.getElementsByTagName(%22head%22)[0].appendChild(e)}})();">jquery-scroll testing</a></p>
</section>
<section>
<a class="source" href="#">view formatted bookmarklet source</a>
Expand All @@ -40,13 +40,13 @@ <h1>jquery-scroll testing bookmarklet</h1>
}

function loadScrollbar(){
jQuery('&lt;link>').attr({
type: 'text/css',
rel: 'stylesheet',
href: 'https://github.com/thomd/jquery-scroll/raw/master/css/scrollbar.css'
jQuery("&lt;link&gt;").attr({
type : 'text/css',
rel : 'stylesheet',
href : 'https://github.com/thomd/jquery-scroll/raw/master/css/scrollbar.css'
}).appendTo('head');
jQuery.getScript('https://github.com/thomd/jquery-scroll/raw/master/jquery.scroll.js', function(){
jQuery('*').filter(function(){return jQuery(this).css('overflow').match(/auto|scroll/)}).scrollbar();
jQuery('*').filter(function(){return jQuery(this).css('overflow').match(/auto|scroll/) || jQuery(this).css('overflow-y').match(/auto|scroll/)}).scrollbar();
});
}

Expand Down
10 changes: 5 additions & 5 deletions bookmarklet.js
@@ -1,4 +1,4 @@
// javascript:(function(){if(typeof%20jQuery==%22undefined%22){var%20c=typeof%20$==%22function%22;a(function(){if(c){jQuery.noConflict()}b()})}else{b()}function%20b(){jQuery(%22<link>%22).attr({type:%22text/css%22,rel:%22stylesheet%22,href:%22https://github.com/thomd/jquery-scroll/raw/master/css/scrollbar.css%22}).appendTo(%22head%22);jQuery.getScript(%22https://github.com/thomd/jquery-scroll/raw/master/jquery.scroll.js%22,function(){jQuery(%22*%22).filter(function(){return%20jQuery(this).css(%22overflow%22).match(/auto|scroll/)}).scrollbar()})}function%20a(f){var%20e=document.createElement(%22script%22);e.src=%22http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js%22;var%20d=false;e.onload=e.onreadystatechange=function(){if(!d&&(!this.readyState||this.readyState==%22loaded%22||this.readyState==%22complete%22)){d=true;f()}};document.getElementsByTagName(%22head%22)[0].appendChild(e)}})();
// javascript:(function(){if(typeof%20jQuery==%22undefined%22){var%20c=typeof%20$==%22function%22;a(function(){if(c){jQuery.noConflict()}b()})}else{b()}function%20b(){jQuery(%22<link>%22).attr({type:%22text/css%22,rel:%22stylesheet%22,href:%22https://github.com/thomd/jquery-scroll/raw/master/css/scrollbar.css%22}).appendTo(%22head%22);jQuery.getScript(%22https://github.com/thomd/jquery-scroll/raw/master/jquery.scroll.js%22,function(){jQuery(%22*%22).filter(function(){return%20jQuery(this).css(%22overflow%22).match(/auto|scroll/)||jQuery(this).css(%22overflow-y%22).match(/auto|scroll/)}).scrollbar()})}function%20a(f){var%20e=document.createElement(%22script%22);e.src=%22http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js%22;var%20d=false;e.onload=e.onreadystatechange=function(){if(!d&&(!this.readyState||this.readyState==%22loaded%22||this.readyState==%22complete%22)){d=true;f()}};document.getElementsByTagName(%22head%22)[0].appendChild(e)}})();

(function(){
if(typeof jQuery == 'undefined'){
Expand All @@ -13,12 +13,12 @@

function loadScrollbar(){
jQuery("<link>").attr({
type: 'text/css',
rel: 'stylesheet',
href: 'https://github.com/thomd/jquery-scroll/raw/master/css/scrollbar.css'
type : 'text/css',
rel : 'stylesheet',
href : 'https://github.com/thomd/jquery-scroll/raw/master/css/scrollbar.css'
}).appendTo('head');
jQuery.getScript('https://github.com/thomd/jquery-scroll/raw/master/jquery.scroll.js', function(){
jQuery('*').filter(function(){return jQuery(this).css('overflow').match(/auto|scroll/)}).scrollbar();
jQuery('*').filter(function(){return jQuery(this).css('overflow').match(/auto|scroll/) || jQuery(this).css('overflow-y').match(/auto|scroll/)}).scrollbar();
});
}

Expand Down

0 comments on commit 32f9680

Please sign in to comment.