Results 1 to 7 of 7

Thread: Script to deactivate / activate a html tag

  1. #1
    Join Date
    Jun 2010
    Posts
    40
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Question Script to deactivate / activate a html tag

    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.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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

  3. #3
    Join Date
    Jun 2010
    Posts
    40
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    The host I'm using is free and does not support php

    The tag I'd like to activate / deactivate is the <style> tag

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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

  5. #5
    Join Date
    Jun 2010
    Posts
    40
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    I didn't find it in the library, were you talking about this script ?

    http://www.dynamicdrive.com/dynamici...etswitcher.htm

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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

  7. The Following User Says Thank You to djr33 For This Useful Post:

    Wisdom (06-23-2010)

  8. #7
    Join Date
    Jun 2010
    Posts
    40
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    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 ?

    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>
    By the way, the default stylesheet shoud be an empty css file right ?

    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 04:34 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •