|
Post by Wormopolis on Oct 5, 2010 14:58:05 GMT -8
Browser Tested: IE and FF placement: global or board footer
This code creates a new UBBC command that lets you create a scrolling div INSIDE a post. you can have whatever content you want inside it, and it has variables to customize its appearance.
code:
<script type="text/javascript"> <!-- // scrollerDiv UBBC in posts // Bones enhanced version // v2.1 // By Wormopolis - [url]www.wormocodes.com[/url]
// use [scrolly:flags][/scrolly] in post around text // flags are: // h(n) height, n=height in pix // w(n) width, n=width in pix // sx scroll x direction // sy scroll y direction // c(hex) color, hex=color in hex: c(FF3324) // bg(URL) background-image, URL = image src // as(style additions) // ac(classname append) // flags seperated by commas: [scrolly:h(100),w(50),sy] blah blah blah [/scrolly]
for (tds=document.getElementsByTagName('td'), i=0; i<tds.length; i++) {
if (tds[i].width=="80%" && tds[i].className.match(/windowbg/) && tds[i].vAlign=="top" && tds[i].innerHTML.match(/\[scrolly(?:\:(.*?))?\]([\s\S]*?)\[\/scrolly\]/i) && !tds[i].innerHTML.match(/\[norunubbc\]/)) { flgs=RegExp.$1; lovetext=RegExp.$2; tmp='<div class="postDiv'+(flgs.match(/ac\(([\w\s]+?)\)/) ? ' '+RegExp.$1:'')+'" style="'+(flgs.match(/h\((\d+)\)/) ? 'height:'+RegExp.$1+';' : '')+(flgs.match(/w\((\d+)\)/) ? 'width:'+RegExp.$1+';' : '')+(flgs.match(/sx/) ? 'overflow-x:auto; white-space: nowrap;' : '')+(flgs.match(/sy/) ? 'overflow-y:auto;' : '')+(flgs.match(/c\((\w+)\)/) ? 'background-color:'+RegExp.$1+';' : '') +(flgs.match(/bg\((\w+)\)/) ? 'background-image:url('+RegExp.$1+');' : '') +(flgs.match(/as\((.+?)\)/) ? RegExp.$1+';':'')+'" '+(flgs.match(/sx/) ? 'noWrap="nowrap" ' : '') + '>'+ lovetext + '</div>';
postCell=tds[i].getElementsByTagName('table')[0].rows[1].cells[0]; postCell.innerHTML=postCell.innerHTML.replace(/\[scrolly(?:\:(.*?))?\]([\s\S]*?)\[\/scrolly\]/i,tmp);
i--; } }
--> </script>
|
|
tanya2byour21
Not New Member
Posts: 1
tanya2byour21 said 0 great things
|
Post by tanya2byour21 on Aug 30, 2011 20:54:40 GMT -8
this code is not working someone told us to use it so we could use a templet she made but it does not seem to be working can you help please.
|
|
|
Post by Wormopolis on Aug 31, 2011 21:10:14 GMT -8
a link to a viewable post would help me out with that.
|
|
|
Post by Dragon on Nov 25, 2011 11:06:15 GMT -8
Im confused. It creates a ubbc button for you to push in to get the scrolling div, or you post this code in baord footer and on that board you can manually just post in the DIV content?
|
|
|
Post by Wormopolis on Dec 2, 2011 12:52:37 GMT -8
wont create a button... mainly because I cant think of what image I would use for it.
it just creates a new UBBC option that lets you wrap text in a scrolling box. just like you can have scrolling boxes in your side tables or affiliates.
// use [scrolly:flags][/scrolly] in post around text // flags are: // h(n) height, n=height in pix // w(n) width, n=width in pix // sx scroll x direction // sy scroll y direction // c(hex) color, hex=color in hex // as(style additions) // ac(classname append) // flags seperated by commas: [scrolly:h(100),w(50),sy] blah blah blah [/scrolly]
sosay you wanted to have a whole bunch of text in a scrolling box, that scrolled vertically you wouldput [scrolly:sy]ALL THE TEXT[/scrolly]
you would see a small box that had a scrollbar on it apear in the post. you can use the other flags to adjust the size, the color, and even add a classname to it in case you wanted to style it with CSS
|
|
|
Post by Wormopolis on Jun 13, 2012 12:00:29 GMT -8
version update 2.1: added in a new flag for a background image since you cant use ( ) in the "as()" flag or it would cut it off
bg(IMAGE URL)
|
|
lockedindreams
Not New Member
Posts: 5
lockedindreams said 0 great things
|
Post by lockedindreams on Jan 9, 2013 18:25:20 GMT -8
|
|
|
Post by Wormopolis on Jan 10, 2013 0:49:24 GMT -8
I dont even see scrolly tags IN that post
|
|
|
Post by Dragon on Jan 12, 2013 22:49:41 GMT -8
Wanted to let you know the scrollbar messes up when special characters are in the div. I had $100,000,000 and it became w(310). Also note that it messes up the div for link buttons if you hit enter instead of space in between the ubbc scrollbar code: [scrolly:h(100),w(310),sy] [/scrolly] Also, I dont suppose you know why its forcing me to add 15 pixels to the width to use the scrollbar on the link buttons ? The link buttons are 150px each, 300 side by side, plus maybe 5 pixels in between... I dont see why its forcing me to stretch to 325 for it to work. If I enter any number less, then it shows the banners in single form instead of doubled up: cloudianpublicity.com/index.cgi?board=tvlocations&action=display&thread=18113Logic fails me in understanding this
|
|
|
Post by Wormopolis on Jan 13, 2013 0:41:47 GMT -8
its because $1 is a reserved placeholder in javascript regexp. try $\1
as for the width, the width INCLUDES scrollbar width
|
|
lockedindreams
Not New Member
Posts: 5
lockedindreams said 0 great things
|
Post by lockedindreams on Jan 13, 2013 16:32:55 GMT -8
So, this is very complicated for me. I'm sorry.... I have a new forum now. What code do you put around a posting table if you want it to show up? Or is there a posting table access code or something?
|
|
|
Post by Wormopolis on Jan 14, 2013 0:34:53 GMT -8
this code is independant of posting tables. you just put whatever content you want to end up inside the scrolling div between the new tags
|
|