Hello,
Does anybody know a script of some sort (not to complicated) to deactivate / activate a html tag, and also to remain deactivated / activated (by visitors choise) when the page is reloaded ?
Thank you.
Hello,
Does anybody know a script of some sort (not to complicated) to deactivate / activate a html tag, and also to remain deactivated / activated (by visitors choise) when the page is reloaded ?
Thank you.
I think it would depend on the tag you want to disable. You could then store it in a cookie.
You could "disable" it by changing its behavior or you could remove the html dynamically.
This might be easier if you are generating the page using a serverside language (like PHP) and can decide to simply not output the tag there.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
The host I'm using is free and does not support php
The tag I'd like to activate / deactivate is the <style> tag
Why don't you just add a style switcher script? I believe there's one here in the DD script library.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
I didn't find it in the library, were you talking about this script ?
http://www.dynamicdrive.com/dynamici...etswitcher.htm
Yes, that's the script. You'd be using external css files rather than <style> tags, but it would have the same effect.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Wisdom (06-23-2010)
It worked but.. when I reloaded the page it didn't work anymore, and it only worked for me
This is how I put the code, is there something wrong with it ?
By the way, the default stylesheet shoud be an empty css file right ?Code:<link rel="stylesheet" type="text/css" href="http://netcustoms.webs.com/farawidget.css" /> <link rel="alternate stylesheet" type="text/css" media="screen" title="test" href="http://netcustoms.webs.com/cuwidget.css" /> <script src="http://www.dynamicdrive.com/dynamicindex9/styleswitch.js" type="text/javascript"></script> <a href="javascript:chooseStyle('none', 60)" checked="checked">-</a> <a href="javascript:chooseStyle('test', 60)">+</a>
Edit: Fixed the problem, I needed to upload the js file
Thank you so much for your help, you have a "Thanks" from me
Have a nice day!
Last edited by Wisdom; 06-23-2010 at 03:34 PM.
Bookmarks