[TYPO3] Filelinks rollover menu

Peter Klein peter at umloud.dk
Wed Oct 25 11:44:49 CEST 2006


Hi Bas. You could create the rollover by using a simple Javascript 
"behaviour", like this:

-- cut --
<script>

 function addEvent(obj, evType, fn, useCapture) {
  if (obj.addEventListener) {
   obj.addEventListener(evType, fn, useCapture);
   return true;
  } else if (obj.attachEvent) {
   var r = obj.attachEvent("on"+evType, fn);
   return r;
  } else {
   alert('Handler could not be attached');
  }
 }
 function setFilelinkBehaviour() {
 divs = document.getElementsByTagName('div');
 for (z = 0; z < divs.length; z++) {
  if ((' '+divs[z].className+' ').indexOf(' filelinks ')>-1) {
   divs[z].onmouseover = setRollover;
   divs[z].onmouseout = removeRollover;
  }
 }
 function setRollover() {
  this.style.color='red';
  this.style.cursor='pointer';
 }
 function removeRollover() {
  this.style.color='black';
  this.style.cursor='pointer';
 }

}
addEvent(window, 'load', function() { setFilelinkBehaviour(); }, false);
</script>
-- cut --

Add the above script to the page, and all DIVS with the class "filelinks" 
will have a rollover/rollout (defined in the 2 functions "setRollover()" and 
"removeRollover()"

-- 
Peter Klein/Umloud Untd


"Bas van der Togt" <b.vandertogt at profinit.com> skrev i en meddelelse 
news:mailman.1.1161691772.5497.typo3-english at lists.netfielders.de...
>I think you're right Peter.
> How can i edit the class <div class="filelinks"> around all the filelinks?
>
> cheers,
> Bas
>
> Peter Russ schreef:
>> Bas van der Togt schrieb:
>> [...]
>>
>>> tt_content.uploads.20.default.split.1.filelink {
>>>   target = _top
>>>   noBlur = 1
>>>   expAll = 1
>>>   wrap = <table border="0" cellspacing="0" cellpadding="0" 
>>> align="center" width="142">|</table>
>>>   NO {
>>
>> is this element supported at filelink?
>>
>>>     allWrap = <tr width="142">|</tr>
>>>     linkWrap = <td class="menu_right" width="115">|</td>
>>>     beforeImg = fileadmin/templates/images/bullet2-o.gif
>>>     beforeROImg = fileadmin/templates/images/bullet1-o.gif
>>>     beforeWrap = <td class="menu_right" valign="top">|</td>
>>>     ATagBeforeWrap = 0
>>>     RO = 1
>>>     expAll = 1
>>>     }
>>> }
>>>
>>
>> Regs. Peter.
>> 





More information about the TYPO3-english mailing list