cross browser issues

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sai26
    New Member
    • Feb 2008
    • 10

    cross browser issues

    how to dynamically set events to work in IE.
    to be specific i want to create dynamically event calls on mouseover
    and assign it dynamically to a perticular <anchor>
  • wyatt
    New Member
    • Feb 2008
    • 6

    #2
    Originally posted by sai26
    how to dynamically set events to work in IE.
    to be specific i want to create dynamically event calls on mouseover
    and assign it dynamically to a perticular <anchor>
    I'm not entirely sure I understand, but try this:
    [CODE=javascript]
    document.getEle mentById('ancho r').onmouseover = function() {
    //onmouseover code here
    }
    [/CODE]

    Comment

    • sai26
      New Member
      • Feb 2008
      • 10

      #3
      can any one help me.
      i am writing a piece of code so that u can understand more precisely.

      [CODE=javascript]window.onload()
      {
      var names = document.getEle mentsByTagName( "a");
      for(var i=0;i<(names.le ngth);i++){
      names[i].setAttribute(" id","a-"+i);
      names[i].setAttribute(" name","a-"+i);
      //---works in netscape not in IE---//
      names[i].setAttribute(" onmouseover","a ad(this,event)" );
      names[i].setAttribute(" onmouseout","cl r()");
      //---------------this piece----------------//
      }
      function aad(com,var)
      {
      alert(com.id+" "+var);
      }[/CODE]
      i am setting the event calls for <anchors> onload and when i actually
      mouse over a perticular <anchor>, it works in netscape i.e call the function
      but it fails 2 work in IE, any alternative for it
      Last edited by gits; Feb 18 '08, 01:07 PM. Reason: added code tags

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        as stated in post #2 ... don't use the setAttribute()-method for this, set the properties directly:

        Code:
        node.onmouseover = funcref;
        or use attachEvent() for IE and addEventListene r() for the rest ;)

        kind regards

        Comment

        • sai26
          New Member
          • Feb 2008
          • 10

          #5
          Originally posted by gits
          as stated in post #2 ... don't use the setAttribute()-method for this, set the properties directly:

          Code:
          node.onmouseover = funcref;
          or use attachEvent() for IE and addEventListene r() for the rest ;)

          kind regards


          thank you v.much i have done some working and got it. even what u said
          works fine.

          Comment

          • sai26
            New Member
            • Feb 2008
            • 10

            #6
            can any 1 explain me how to track the mouse position when the page actually scrolls. i am tracking mouseover events and getting a popup, it works fine when the page does not scroll down, but when on scroll its displaying the popup on the page before the scroll.....
            can i find any help regarding this?

            Comment

            • gits
              Recognized Expert Moderator Expert
              • May 2007
              • 5390

              #7
              have a loook at the scrolling offset - section here ...

              kind regards

              Comment

              • sai26
                New Member
                • Feb 2008
                • 10

                #8
                can any 1 explain how to make a html form readonly when something pops up?

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  Originally posted by sai26
                  can any 1 explain how to make a html form readonly when something pops up?
                  Heh, are you going to ask all your questions in one thread?

                  What do you mean by something pops up? A window popup?

                  To make something readonly, set the readOnly property. You may not be able to set the readOnly property for all elements, e.g. a select element.

                  What you can do, however, is put a transparent div over the form which won't allow interaction with the form.

                  Comment

                  Working...