Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Changing Table's Image [modified]

Changing Table's Image [modified]

Scheduled Pinned Locked Moved ASP.NET
javascriptcsshelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Eddie1987
    wrote on last edited by
    #1

    I want that when i will enter the TextA i will see on the third table pic b (Winter) and when i will enter TextB i will see on the third table pic c (Sunset) Please help !!! <%--When mouse will be over the text then i want the third table will show pic (Winter)--%>

    ChangeToPicA -> The Text

    <%--When mouse will be over the text then i want the third table will show pic (Sunset)--%>

    ChangeToPicB -> The Text

    <%--The third table which need to change the pictures--%>

    JScript2.js function showPic(id) { document.getElementById("Sunset").className = "c"; document.getElementById("Winter").className = "b"; document.getElementById(id).className = "picshow"; } stylesheet.css .c { background-image: url('Sunset.jpg'); background-repeat:no-repeat; } .b { background-image: url('Winter.jpg'); background-repeat:no-repeat; } .pichide { display: none; } .picshow { display: block; border: 1px; } -- Modified Monday, August 1, 2011 9:18 AM

    N 1 Reply Last reply
    0
    • E Eddie1987

      I want that when i will enter the TextA i will see on the third table pic b (Winter) and when i will enter TextB i will see on the third table pic c (Sunset) Please help !!! <%--When mouse will be over the text then i want the third table will show pic (Winter)--%>

      ChangeToPicA -> The Text

      <%--When mouse will be over the text then i want the third table will show pic (Sunset)--%>

      ChangeToPicB -> The Text

      <%--The third table which need to change the pictures--%>

      JScript2.js function showPic(id) { document.getElementById("Sunset").className = "c"; document.getElementById("Winter").className = "b"; document.getElementById(id).className = "picshow"; } stylesheet.css .c { background-image: url('Sunset.jpg'); background-repeat:no-repeat; } .b { background-image: url('Winter.jpg'); background-repeat:no-repeat; } .pichide { display: none; } .picshow { display: block; border: 1px; } -- Modified Monday, August 1, 2011 9:18 AM

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      First, FORMAT your code snippets!!! Creating tables for one cell is extreme overkill.

      Text A
      Text B

      span, img
      {
      display:block;
      }

      $(document).ready(function()
      {
      $("#text1").hover(function()
      {
      $("#pic").attr("src", "Sunset.jpg");
      });
      $("#text2").hover(function()
      {
      $("#pic").attr("src", "Winter.jpg");
      });
      });


      I know the language. I've read a book. - _Madmatt

      modified on Monday, August 1, 2011 9:25 AM

      E 1 Reply Last reply
      0
      • N Not Active

        First, FORMAT your code snippets!!! Creating tables for one cell is extreme overkill.

        Text A
        Text B

        span, img
        {
        display:block;
        }

        $(document).ready(function()
        {
        $("#text1").hover(function()
        {
        $("#pic").attr("src", "Sunset.jpg");
        });
        $("#text2").hover(function()
        {
        $("#pic").attr("src", "Winter.jpg");
        });
        });


        I know the language. I've read a book. - _Madmatt

        modified on Monday, August 1, 2011 9:25 AM

        E Offline
        E Offline
        Eddie1987
        wrote on last edited by
        #3

        i wrote the text which on mouseover it will make that changing is in lines 9, 17

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups