|
|
 |
Re: FN-FORUM: Javascript problem (another one!)
date posted 8th August 2003 16:47
hey nita,
good luck with it - go take a break and come back ;-)
toggling the visibility should be the easiest method - let me know if i=20=
can help make things any clearer
luke
On Friday, August 8, 2003, at 04:35 PM, Nita wrote:
>
> Thanks very much Luke, I'm not sure how clear it is yet, but I'll give=20=
> it a
> go.... basically to describe what you would have seen....
>
> I have a div on the left hand side of the page which contains a list =
of
> links - linking to text telling people what they need to know to do an
> online (French) course. The idea is that when the link is clicked the=20=
> text
> appears in the div specially made for it on the right hand side of the
> screen - so the info is available if it's needed and there's no large=20=
> scroll
> required...
>
> So I shall attach the code to the things I have and see what happens!
>
> Thanks very much, again for the help, it's driving me nuts!
> Nita
> ;o)
> ----- Original Message -----
> From: "Luke Perman" [EMAIL REMOVED]
> To: [EMAIL REMOVED]
> Sent: Friday, August 08, 2003 2:30 PM
> Subject: Re: FN-FORUM: Javascript problem (another one!)
>
>
>>
>> hi nita,
>>
>> yea, i'm not sure what the problem is -- i have the same trouble with
>> my new re-designed website - i've converted the whole site to be CSS
>> driven and now it freezes up in IE on the mac! everything works fine
>> in Windoze though -- so i'm gonna have to do some figuring out on the
>> mac side..
>>
>>
>> here's a really simple piece of javascript for swapping the =
visibility
>> of a DIV:
>>
>>
>> function swapIn(thisone) {
>> theLayer=3Dthisone+"layer";
>> document.all[theLayer].style.visibility =3D 'visible';
>> }
>>
>> function swapOut(thisone) {
>> theLayer=3Dthisone+"layer";
>> document.all[theLayer].style.visibility =3D 'hidden';
>> }
>>
>>
>>
>> #biglayer { visibility: hidden; }
>>
>>
>>
>> and in the BODY, the DIV needs to be named 'whateverlayer', then
>> simply add the onClick or onMouseover property to your link that=20
>> causes
>> the action:
>>
>> la la la la la
>>
>>
>>
>>
>> you may have to do some fiddling with the 'position' and 'display'
>> attributes in your CSS to get the DIV to behave as you want it to...
>>
>> the reason i create the variable "theLayer" inside the function is=20
>> that
>> i usually have an image change associated with the layer swap also,=20=
>> and
>> so the functions 'swapIn' and 'swapOut' will have the extra line:
>>
>> document.images[thisone].src =3D myImages[3].src;
>>
>> to handle that action in the same breath, having the image named the
>> same as the layer (minus the 'layer' suffix of course...)
>>
>>
>> er, i hope that's all clear hehe
>> luke
>>
>>
>> On Friday, August 8, 2003, at 02:10 PM, Nita wrote:
>>
>>> Thanks Luke, that's great, I was considering using the visibilty of=20=
>>> the
>>> layers as my next option.... I shall use this instead... I'd be=20
>>> really
>>> grateful for code snippets, thanks very much!
>>>
>>> Sorry about the crashing! Is there any known reason why it might do
>>> that?
>>> I've had a similar problem with another page I made using =
stylesheets
>>> which
>>> crashed a friends Mac...
>>
>>
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> fido.net are pleased to sponsor these Freelancers messages. For all
>> your web hosting needs check out http://www.fido.net/ with hosting
>> packages starting from just =A346.95 a year including VAT.
>> Free 0871 Fax2Email numbers also available online!
>> http://www.fido.net/ - the internet made simple! - 0800 1072 666
>>
>> To advertise here: http://www.freelancers.net/advertising.html
>>
>>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> fido.net are pleased to sponsor these Freelancers messages. For all
> your web hosting needs check out http://www.fido.net/ with hosting
> packages starting from just =A346.95 a year including VAT.
> Free 0871 Fax2Email numbers also available online!
> http://www.fido.net/ - the internet made simple! - 0800 1072 666
>
> To advertise here: http://www.freelancers.net/advertising.html
>
> |
 |
|