Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts

    How to style this javascript - is it possible?

    OK this is a line of javascript which is "Live Chat" feature. It works great and the style matches 100% the rest of the page design and font etc.

    However - what I am trying to do is change the color of this javascript live chat link in the navigation.

    So the question is - can I manually (in-line) change the font color of this following javascript code?

    Here it is:

    Code:
            <!-- BEGIN ProvideSupport.com Text Chat Link Code -->
    <div id="sjkdUia" style="z-index:100;position:absolute"></div><div id="sjkdUia" style="display:inline"></div><div id="sjkdUia" style="display:none"></div><script type="text/javascript">var sjkdUia=document.createElement("script");sjkdUia.type="text/javascript";var sjkdUia=(location.protocol.indexOf("https")==0?"https":"http")+"://image.providesupport.com/js/1ejsthvyh0azeasdh/safe-textlink.js?ps_h=Ci9a&ps_t="+new Date().getTime()+"&online-link-html=Live%20Chat&offline-link-html=Contact%20Us";setTimeout("sjkdUia.src=sjkdUia;document.getElementById('sjkdUia').appendChild(sjkdUia)",1)</script><noscript><div style="display:inline"><a href="http://www.providesupport.com?messenger=1ejsthvyhdsafchzi63uh">Contact</a></div></noscript>
    <!-- END ProvideSupport.com Text Chat Link Code --></a></li>
    So that is the Javascript - can I make that text link change color by inserting something there? I tried a few things like adding color to the inline bit of the code but it didnt work.

    Or must I edit this bit?

    Code:
    <nav>
    	<ul class="list-site-nav clearfix">
            
    	<li><a class="page-link" href="">Page</a></li>    
    	<li><a class="page-link" href="">Page</a></li
    	<li><a class="page-link" href="">Page</a></li
    	<li><a class="page-link" href="">Page</a></li
    	<li><a class="page-link" href="">Page</a></li
    	
    	</ul>
    </nav>
    Perhaps it is easiest to make a seperate <li> class right? Personally I just think trying to change the font color within the javascript would be easiest.

    Thanks a lot.

  • #2
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Hi - I am just updating my own thread here but I *think* I solved it by creating a new <li> class specifically for the javascript and that seems to work ok.

    So, CSS came to my rescue. Would you have used CSS or is it possible to style Javascript?

    (basic question I know but I just wanna hear from you guys thanks).

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,027
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    Quote Originally Posted by listerdl View Post
    Hi - I am just updating my own thread here but I *think* I solved it by creating a new <li> class specifically for the javascript and that seems to work ok.

    So, CSS came to my rescue. Would you have used CSS or is it possible to style Javascript?

    (basic question I know but I just wanna hear from you guys thanks).
    As you say, use CSS.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

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