This extension beautify the vertical and horizontal bars (scrolling) by javascript
Requirements ¶
- Developed and tested with Yii 1.1.12 but may working with older versions too.
- JQuery
Usage ¶
To use the EJsScroll extension
- extract archive in your extensions folder
- put the above code in your view or controller file
Yii::app()->clientScript->registerCoreScript('jquery'); //if you do not set it yet
$this->widget('ext.EJsScroll.EJsScroll',
array(
'selector' => '#content',
'showArrowsBar'=>false
)
);
'selector' is the div or whatever you want to do scrollable (default '#content') 'showArrowsBar' false or true to show box-arrows on the edge of the scrollbar (default true)
Also if you want to styling a selector (to make it scrollable) on specific action you can add this (as example)
Yii::app()->clientScript->registerCss('MyScrollPage','#content {position:relative; top:20px; height:500px; width:800px; margin:auto;}');
you could also modify jquery.jscrollpane.css and the scrollstyle.css files of protected/extensions/EJsScroll/assets/css folder to styling the scrollbar. (on YII_DEBUG = true)
User Contributed Notes 7
Good!
Hi... this is good extension scroll! thanks
Acknowledgements
Thank you Rochim :)
multiple scrollbars in the same view
When I am trying to add multiple scrollbars in the same view, the widget only appends on one selector, is there any workaround? or a chance to fix it?
,Re: multiple scrollbars
Hi spyfx
Did you try by using class instead id ?
for example replace all #content with .allbars
...
'selector' => '.allbars',
...
also add class for all html elements that you want to make theme scrollable
multiple scrollbars - works!
I still dont know why I didnt think about that - works pretty well. Btw great extension! keep goin on!
Make it using simple way
There are cases the solution is more simple than we could think! :)
So make it simple
Thanks spyfx for your feedback and for your comment!
great
Thanks man. It works great right out of the box
Leave a comment
If you have any questions, please ask in the forum instead.
Join the conversation to share a note.