Announcement

Collapse
No announcement yet.

Looking for "java rollover" code that will work on touchscreen

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Looking for "java rollover" code that will work on touchscreen

    Greetings,

    Anyone have any "rollover" image code that works on touchscreens? The one I use does not work as there is no "MouseOver" on a touchscreen. I want to get the graphic to change when touched signifiying "on"...no what I mean?.

    Here is the code I use on standard browsers.


    <a href="remote.asp" onClick="if(document.images) document.home0.src='/rover/icons/home-on.gif';"
    onMouseOver="if(document.images) document.home0.src='/rover/icons/home-on.gif';"
    onMouseOut="if(document.images) document.home0.src='/rover/icons/home-off.gif';" >
    <IMG NAME="home0" SRC="/rover/icons/home-off.gif" BORDER="0"></a>

  • #2
    Hi Kevin,

    Which touchscreen are you using? Rollovers do work on some touchscreens like the CF-01, if you select the "no click" stylus behavior. This way you can touch the screen without simulating a mouse-click. That's the main issue with using touchscreens, if you use the default stylus behavior, as soon as you touch the screen to move the cursor, it also simulates a mouse click so there's no "onmouseover" event.

    You could try something like this:

    <pre class="ip-ubbcode-code-pre">&lt;a href=remote.asp
    onMouseDown="if(document.images) document.home0.src='/rover/icons/home-on.gif';"
    onMouseOut="if(document.images) document.home0.src='/rover/icons/home-off.gif';" &gt;
    &lt;IMG NAME="home0" SRC="/rover/icons/home-off.gif" BORDER="0"&gt;&lt;/a&gt; </pre>

    If you click on the image and hold the stylus down, the image should change. If you lift the stylus, the browser will go to the URL, but if you drag the stylus out of the picture before lifting it, then the browser will stay on the current page.

    Cheers
    Al
    HS 3.0.0.548: 1990 Devices 1172 Events
    Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

    Comment


    • #3
      I am using a Toshiba E740 Pocket PC with windows CE 2002. I cannot find any menus to change the stylus settings. The code provided above does not show any image when I tested it. Someone must have some Java code that will do the "On/Off".

      Any other ideas?

      Comment


      • #4
        I'm confused. From your first post it sounds like you want to click the icon and have it change, not just hover over it with the mouse (which you can't do with most touchscreens).

        Are you talking about changing the icon once you touch it, as in if it is off, clicking it changes it to on, or vice versa?

        - Gordon

        "Remember the days when you could go into a store and ask the store manager when something they were out of was coming in? Whatever happened to that? Store managers these days only know that 'corporate' is sending a truck next Tuesday. They have no idea what's on it... What a way to do business."
        |
        | - Gordon

        "I'm a Man, but I can change, if I have to, I guess." - Man's Prayer, Possum Lodge, The Red Green Show
        http://HiddenGemTech.com - http://MaineMusiciansExchange.org - http://www.WJZF.org

        Comment


        • #5
          Gordon,

          That is correct. I want it to change when the sylus touches it.

          Kevin

          Comment


          • #6
            That's not mouse-over or other code - it's part of the forms submission so that the image is actually changed on a page refresh or dynamic icon refresh. I don't do this on my systems, but I do use current device status to determine background colors in places to show a device on or off each time the page is refreshed - my code is in VBScript. Someone better versed in DHTML could probably help you out.

            - Gordon

            "Remember the days when you could go into a store and ask the store manager when something they were out of was coming in? Whatever happened to that? Store managers these days only know that 'corporate' is sending a truck next Tuesday. They have no idea what's on it... What a way to do business."
            |
            | - Gordon

            "I'm a Man, but I can change, if I have to, I guess." - Man's Prayer, Possum Lodge, The Red Green Show
            http://HiddenGemTech.com - http://MaineMusiciansExchange.org - http://www.WJZF.org

            Comment


            • #7
              Try searching for Hidden Frame. This works quite well with my Audrey units. I can setup a single lightbulb icon to control lights. Touch the icon image on the Audrey's screen, lights go on and icon changes to a "on" image, touch it again and lights go off and image becomes an "off" image. This happens without a screen refresh which is really great since the Audrey units are not that fast with the screen refreshes.

              Your browser does need to support frames for this to work, I'm not sure if your Pocket PC supports frames.

              The Pod

              Comment

              Working...
              X