Javascript Tooltips, Popups, Captions - BoxOver  

Go Back   Javascript Tooltips, Popups, Captions - BoxOver > BoxOver > Suggestions
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2007, 09:10 PM
waveform waveform is offline
Junior Member
 
Join Date: Apr 2007
Posts: 3
Default Setting default opacity "opacity=[xxx]"

HI all, great library, top work!

I had one gripe, which was I didn't like the default 85% opacity and wanted to change it without having to create a whole new css just for that. So I implemented a new parameter, simply called "opacity" which you set to anything up to 100.

Lines changed are as follows (asterisk next to the added/changed lines):

Code:
function scanBO(curNode) { if (checkElemBO(curNode.title)) { * curNode.opacity=getParam('opacity',curNode.title); * if(curNode.opacity=='') curNode.opacity = '85'; curNode.boHDR=getParam('header',curNode.title); curNode.boBDY=getParam('body',curNode.title);
Note for above: I use '85' as the default opacity if none is specified. Ideally, it should be taken from the existing style, in case a custom style is used. And of course I'm assuming the same opacity is wanted for both header and body.

Code:
function applyStyles() { ... (several lines up here) ... dvHdr.innerHTML=CBE.boHDR; dvBdy.innerHTML=CBE.boBDY; * // apply preferred opacity * dvHdr.style.filter='alpha(opacity=' + CBE.opacity + ')'; // IE * dvHdr.style.opacity='' + (CBE.opacity / 100); // FF * dvBdy.style.filter='alpha(opacity=' + CBE.opacity + ')'; // IE * dvBdy.style.opacity='' + (CBE.opacity / 100); // FF ah=false; ab=false;
That's it I think. May be a better way of doing it, but that was quick and easy. Now you can put "opacity=[100]" in your parameter list to change the default!

Thanks again for a great library, it rocks.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 12:01 AM.