How to change onmouseover and onmouseout dynamically

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default How to change onmouseover and onmouseout dynamically

    Hi, I control the style of a button like the code below

    Private Sub Change_Color()
    Button1.Style("BACKGROUND-COLOR") = "#CEB57B"
    Button1.Style("COLOR") = "White"
    End Sub

    How can I do the same with Button1's onmouseover and onmouseout style?

    (Language VB.NET)

    T.I.Rislaa



    Tor Inge Rislaa Guest

  2. Similar Questions and Discussions

    1. Change Content Dynamically
      I'm trying to find a way to change the contents of a table (calendar) that I have nested in a DIV. without loading a new page. In other words, go...
    2. Reliable onmouseout in IE
      Been pounding my head a bit over mouse out events in IE. I need a general solution to the following sort of situation. Designer has an element...
    3. Change DataNavigateUrlField dynamically
      Hi guys, let's see if someone can give me a small hand with this.... i'm populating a dataset that sometimes changes 1 or 2 columns depending on...
    4. Dynamically change URL in Web Service
      Dear Al I am now also facing a problem on changing URL in web reference. Firstly, i added a web reference in my project, and then i change the...
    5. dynamically change
      I need to know how to modify the <asp:BoundColumn/> to N/A when the datafield value comes in as negative quantity and color it different on the...
  3. #2

    Default Re: How to change onmouseover and onmouseout dynamically

    Tor,

    Button1.Attributes.Add("onmouseover",
    "javascript:this.style.color='White';this.style.ba ckground-color='#CEB57B';"
    )

    Button1.Attributes.Add("onmouseout", "javascript: ... ;")

    Should do it for you.

    (I'm not positive I've specified the styles properly. I'm borrowing the
    format from a cursor change that I do:
    "javascript:this.style.cursor='pointer';" but I'm pretty sure it will work.

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche
    "Tor Inge Rislaa" <tor.inge.nospam@rislaa.no> wrote in message
    news:%23%23Eog4BXDHA.1384@TK2MSFTNGP10.phx.gbl...
    > Hi, I control the style of a button like the code below
    >
    > Private Sub Change_Color()
    > Button1.Style("BACKGROUND-COLOR") = "#CEB57B"
    > Button1.Style("COLOR") = "White"
    > End Sub
    >
    > How can I do the same with Button1's onmouseover and onmouseout style?
    >
    > (Language VB.NET)
    >
    > T.I.Rislaa
    >
    >
    >

    S. Justin Gengo Guest

  4. #3

    Default Re: How to change onmouseover and onmouseout dynamically

    You don't want the "javascript:" unless you're putting the code into the
    href attribute of an anchor tag. Just add "this.style.color...".
    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]

    "S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message
    news:u6619PCXDHA.3248@tk2msftngp13.phx.gbl...
    > Tor,
    >
    > Button1.Attributes.Add("onmouseover",
    >
    "javascript:this.style.color='White';this.style.ba ckground-color='#CEB57B';"
    > )
    >
    > Button1.Attributes.Add("onmouseout", "javascript: ... ;")
    >
    > Should do it for you.
    >
    > (I'm not positive I've specified the styles properly. I'm borrowing the
    > format from a cursor change that I do:
    > "javascript:this.style.cursor='pointer';" but I'm pretty sure it will
    work.
    >
    > Sincerely,
    >
    > --
    > S. Justin Gengo, MCP
    > Web Developer
    >
    > Free code library at:
    > [url]www.aboutfortunate.com[/url]
    >
    > "Out of chaos comes order."
    > Nietzche
    > "Tor Inge Rislaa" <tor.inge.nospam@rislaa.no> wrote in message
    > news:%23%23Eog4BXDHA.1384@TK2MSFTNGP10.phx.gbl...
    > > Hi, I control the style of a button like the code below
    > >
    > > Private Sub Change_Color()
    > > Button1.Style("BACKGROUND-COLOR") = "#CEB57B"
    > > Button1.Style("COLOR") = "White"
    > > End Sub
    > >
    > > How can I do the same with Button1's onmouseover and onmouseout style?
    > >
    > > (Language VB.NET)
    > >
    > > T.I.Rislaa
    > >
    > >
    > >
    >
    >

    John Saunders Guest

  5. #4

    Default Re: How to change onmouseover and onmouseout dynamically

    And remember to set Content-Script-Type, either in HTTP headers or through a
    META tag...

    Jerry

    "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    news:%23o2H3LDXDHA.1620@TK2MSFTNGP12.phx.gbl...
    > You don't want the "javascript:" unless you're putting the code into the
    > href attribute of an anchor tag. Just add "this.style.color...".
    > --
    > John Saunders
    > Internet Engineer
    > [email]john.saunders@surfcontrol.com[/email]
    >
    > "S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message
    > news:u6619PCXDHA.3248@tk2msftngp13.phx.gbl...
    > > Tor,
    > >
    > > Button1.Attributes.Add("onmouseover",
    > >
    >
    "javascript:this.style.color='White';this.style.ba ckground-color='#CEB57B';"
    > > )
    > >
    > > Button1.Attributes.Add("onmouseout", "javascript: ... ;")
    > >
    > > Should do it for you.
    > >
    > > (I'm not positive I've specified the styles properly. I'm borrowing the
    > > format from a cursor change that I do:
    > > "javascript:this.style.cursor='pointer';" but I'm pretty sure it will
    > work.
    > >
    > > Sincerely,
    > >
    > > --
    > > S. Justin Gengo, MCP
    > > Web Developer
    > >
    > > Free code library at:
    > > [url]www.aboutfortunate.com[/url]
    > >
    > > "Out of chaos comes order."
    > > Nietzche
    > > "Tor Inge Rislaa" <tor.inge.nospam@rislaa.no> wrote in message
    > > news:%23%23Eog4BXDHA.1384@TK2MSFTNGP10.phx.gbl...
    > > > Hi, I control the style of a button like the code below
    > > >
    > > > Private Sub Change_Color()
    > > > Button1.Style("BACKGROUND-COLOR") = "#CEB57B"
    > > > Button1.Style("COLOR") = "White"
    > > > End Sub
    > > >
    > > > How can I do the same with Button1's onmouseover and onmouseout style?
    > > >
    > > > (Language VB.NET)
    > > >
    > > > T.I.Rislaa
    > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Jerry III Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139