Results 1 to 4 of 4

Thread: Onmouseover,call function but as cursor moves - cursor changes whole time!

  1. #1
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Onmouseover,call function but as cursor moves - cursor changes whole time!

    Hi, I need help please!

    Onmouseover it calls a function, but onmouseover the image it changes the cursor from default ot busy the whole time.

    I want it to stay to default.
    I have set it o default in the div, function & onmouseover but it stil does that

    Code:
       <div id="hoverText2" class="main" style="padding: 5px; position: absolute; display: none; width: 200px; cursor : default;"></div>
    
              <script type="text/javascript">
                var hoverText2 = document.getElementById('hoverText2');
                function showHover2(txt, e){
                if(document.all){
                xpos = event.clientX + document.body.scrollLeft;
                ypos = event.clientY + document.body.scrollTop;
                }
                else{
                xpos = e.pageX;
                ypos = e.pageY;
                }
    
                hoverText2.innerHTML = txt;
                hoverText2.style.left = "-50px";
                hoverText2.style.top = ypos + 4 + 'px';
                hoverText2.style.display = "block";
                hoverText2.style.cursor = "default";
    
                }
                function hideHover2(){
                hoverText2.innerHTML = "";
                hoverText2.style.display = "none";
                }
              </script>
              
              <xsl:element name="asp:image">
                <xsl:attribute name='id'>ttip_<xsl:value-of select='$nextNode/@name' /></xsl:attribute>
                <xsl:attribute name='runat'>server</xsl:attribute>
                <xsl:attribute name='imageurl'>images/help.jpg</xsl:attribute>
                <xsl:attribute name='style'>cursor:default</xsl:attribute>
                <xsl:attribute name='onmousemove'>ttip_<xsl:value-of select='$nextNode/@name' />.style.cursor = 'default'; showHover2('<xsl:value-of select="$nextNode/Tooltip" />', event)</xsl:attribute>
                <xsl:attribute name='onmouseout'>hideHover2()</xsl:attribute>
                <xsl:attribute name='class'>main</xsl:attribute>
              </xsl:element>
    Please Any Ideas!

    Regards
    Last edited by jscheuer1; 01-25-2008 at 04:28 PM. Reason: add code tags

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,133
    Thanks
    44
    Thanked 3,229 Times in 3,190 Posts
    Blog Entries
    12

    Default

    That isn't a valid xsl stylesheet, I think you meant for the two code blocks to be separate, but that isn't how you had it in your post. Are you serving xml or using javascript to incorporate it into another HTML based page? In any case:

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question The xslt loads aspx pages

    Hi, Thank You for the assist - the xslt file loads aspx files, That Flowcentric uses as it's stylesheet. The
    The code is a portion directly from my xslt file, whuch handles the tooltip - i just can't get the mouse to stay default but as move it changes from default to busy loading & then again back the entire time on mousemove over.

    [code]
    <td align="left">
    <xsl:if test="$nextNode/Tooltip != ''">
    <div id="hoverText2" class="main" style="background: url(../../images/template/glass/c.png); padding: 5px;display: none; width: 200px; cursor : default;"></div>

    <script type="text/javascript">
    var hoverText2 = document.getElementById('hoverText2');
    function showHover2(txt, e){
    if(document.all){
    xpos = event.clientX + document.body.scrollLeft;
    ypos = event.clientY + document.body.scrollTop;
    }
    else{
    xpos = e.pageX;
    ypos = e.pageY;
    }

    hoverText2.innerHTML = txt;
    hoverText2.style.left = "-50px";
    hoverText2.style.top = ypos + 4 + 'px';
    hoverText2.style.display = "block";
    }
    function hideHover2(){
    hoverText2.innerHTML = "";
    hoverText2.style.display = "none";
    }
    </script>

    <xsl:element name="asp:image">
    <xsl:attribute name='id'>ttip_<xsl:value-of select='$nextNode/@name' /></xsl:attribute>
    <xsl:attribute name='runat'>server</xsl:attribute>
    <xsl:attribute name='imageurl'>images/help.jpg</xsl:attribute>
    <xsl:attribute name='style'>cursor:default</xsl:attribute>
    <xsl:attribute name='align'>middle</xsl:attribute>
    <xsl:attribute name='onmousemove'>{concat('ttip_',$nextNode/@name)}.style.cursor = 'default'; showHover2('<xsl:value-of select="$nextNode/Tooltip" />', event)</xsl:attribute>
    <xsl:attribute name='onmouseout'>hideHover2()</xsl:attribute>
    <xsl:attribute name='class'>main</xsl:attribute>
    </xsl:element>

    </xsl:if>


    Link: I'm not sure if you can access it as it requires a login, but if you can
    move cursor over image!
    http://srv08-za119/fcParmalatTest/myProcessItem.aspx?g=14&id=49

    Hope this is what was required.

    Please Assist!

  4. #4
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile Got it sorted out!

    Hi, Thanks for the assist got it sorted out!
    I had to remove : style="background: url(../../images/template/glass/c.png);
    it was trying to load the image the whole time!

    Thank You

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
  •