If you have only one link inside a single block container, and you
want the entire block to respond to a click as if it was the link
inside it, you can try the following bit of script (added through
Protaculous).
First, you have to mark your box as something that the function needs
to “watch”. The easiest way to do that is to give it a CSS class. You
don’t have to add that class to your styles, just apply it uniformly
to the elements on your page that need this effect. So click once on
such a block so its selection handles show, then open Item / Extended
from the main menu. Click New, make sure the DIV tab is selected
(should be default) and then in the sub-dialog, enter:
- Name: class
- Value: blockLink
(you want to only enter the parts after the colons, the rest is there
to be illustrative of the dialog structure)
Now ensure that every one of the blockLink boxes on your page contain
only one hyperlink. There can be lots of other text, but just one
hyperlink.
Now apply Protaculous to the page, and paste the following into one of
the Function Body editors (top one is preferred, because it will wire
up the effect before the page has even appeared, rather than waiting
until all of the graphics etc. have finished downloading to the
browser).
$$('.blockLink').each(function(elm){
var a = elm.down('a');
if(a){
elm.setStyle('cursor:pointer');
elm.observe('click',function(evt){
window.location.href = a.href;
});
}
});
You could take this a little further by adding an observer to the
mouseenter/mouseleave events (5.5 only), or with a lot more code, the
mouseover/mouseout events, and use those observers to swap background
colors or other style attributes to give a hover effect to your box.
Walter
On Dec 1, 2010, at 9:24 AM, brm98 wrote:
"Sorry didn’t make that clear - you could insert a graphic box in a
run of text - and put your link text in it - and then apply the
rollover action to the graphic box.
D"
That was my first thought. I was trying to avoid too may graphics
on one page. In hopes it would load faster?
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options