Results 1 to 3 of 3

Thread: Links & Background Images

  1. #1
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Links & Background Images

    1) Describe Problem:
    I have created a web site that has expand and collapse links. I would like to add a background image behind the expand/collapse link. Everything I do does not work. Any ideas? This could be a plus sign when it is collapsed or a minus sign when it is expanded. Anything to illustrate that this item is expandable or collapsible.

    2) Here is the code:
    <TITLE>Expand & Collapse 1</TITLE>

    <script type="text/javascript">

    function showHideMe(id){
    if(document.getElementById(id).style.display=="none"){
    document.getElementById(id).style.display="block"
    }
    else{
    document.getElementById(id).style.display="none"
    }
    }

    </script>

    <style type="text/css">
    .expands{
    width:390px;
    cursor:hand;
    cursorointer;
    }
    </style>

    <div class="expands" onclick="showHideMe('div1')"><b>Southampton History...</b></div>
    <div id="div1" style="display:none;border:1px solid #5555AA;background-color:#AAF;width:460px">
    Under Construction.<br />
    <img border="0" src="images/underconstruction.gif" width="309" height="245"><br />
    Coming Soon.
    </div>



    Anything would be much appreciated...

    Thanks,
    Brad

  2. #2
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Did you try: background-image: url("YOUR IMAGE URL"); in your expands selector?

    EDIT: After re-reading your post, I am a little confused. Do you want a BG image or a +/- image? The latter is <img id='OPEN' src="MyImage" height="" width=""> and then have your JS function hide it. Am I on the right track?
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  3. #3
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the response. I ended up switching to a plus/minus style -- off of this web site. The only problem is that in IE everything works well but in firefox the list of expandable (+/-) seem to cascade down the page. Any ideas... I understand that firefox reads the code correctly and IE sort of guesses.

    My web link: http://members.shaw.ca/kylegar/parts.html

    Thanks,

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
  •