Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery custom scroll bar on an iframe

I'm looking for a solid cross-browser Jquery custom scroll bar plugin that plays nice with iframes. Does anyone have a nice plugin and a solution?

like image 928
user772575 Avatar asked Jul 14 '11 05:07

user772575


1 Answers

Depends greatly on the context:

  • Do you want to create an iframe with styled scrollbars that other people can place on their site?
  • Or are you trying to style someone else's content which is placed on your site via iframe?

If you have control over the content of the iframe, then it's an easy thing to do. I've used http://livepipe.net/ with success.

Custom scrollbars typically work by placing content in a , then moving that element relative to a parent div by javascript.

EDIT 1:

This is the detail page. Just start editing the values. http://livepipe.net/control/scrollbar

You'll know you have it right when loading your page not in an iframe, the fancy scrollbars are 100% the height of your browser viewport no matter the height.

It might also be worth adding a function to recalculate the height of the objects & the positioning of the bottom control on window resize. Although, that's easier to do with jQuery than in PrototypeJS.

EDIT 2: Here's a working example I cooked up: http://pastebin.com/gvtnLANQ

like image 181
Mike Figueroa Avatar answered Nov 07 '22 10:11

Mike Figueroa