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. displaying a div dynamically whereever dropdownlist Box is present above it. [modified]

displaying a div dynamically whereever dropdownlist Box is present above it. [modified]

Scheduled Pinned Locked Moved ASP.NET
javascriptdatabasesysadminhelp
6 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.
  • S Offline
    S Offline
    sishya
    wrote on last edited by
    #1

    Hi, i have a dropdownlist in which on changing the selection i have to give a tooltip above it to display the item selected because the size of the dropwnlist is small to accomodate the entire text .I tried in a dummy page like this. div id="tooltip" style="LEFT: 488px; WIDTH: 229px; POSITION: absolute; TOP: 130px; HEIGHT: 19px" noWrap> asp:dropdownlist id="ddl" oonkeyup='showTooltip()' style="Z-INDEX: 101; LEFT: 518px; " runat="server" Width="66px" !--> But in real scenario in all the pages in which i have dropdownlist i have to incorporate this feature,but i cant change the layout of these pages to accomodate a div .So is there a way to show this tooltip dynamically using javascript (i.e even the div has to be created dynamically just above the ddl)on onkeyup event of the dropdownlist. pls help me on this , thnks in advance -- modified at 8:20 Friday 23rd June, 2006

    N 1 Reply Last reply
    0
    • S sishya

      Hi, i have a dropdownlist in which on changing the selection i have to give a tooltip above it to display the item selected because the size of the dropwnlist is small to accomodate the entire text .I tried in a dummy page like this. div id="tooltip" style="LEFT: 488px; WIDTH: 229px; POSITION: absolute; TOP: 130px; HEIGHT: 19px" noWrap> asp:dropdownlist id="ddl" oonkeyup='showTooltip()' style="Z-INDEX: 101; LEFT: 518px; " runat="server" Width="66px" !--> But in real scenario in all the pages in which i have dropdownlist i have to incorporate this feature,but i cant change the layout of these pages to accomodate a div .So is there a way to show this tooltip dynamically using javascript (i.e even the div has to be created dynamically just above the ddl)on onkeyup event of the dropdownlist. pls help me on this , thnks in advance -- modified at 8:20 Friday 23rd June, 2006

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

      You could insert the div into the DOM dynamically from JavaScript, or possibly have a floating div on the page. I like the implementation www.netflix.com[^] uses when you hover over a movie.

      S 1 Reply Last reply
      0
      • N Not Active

        You could insert the div into the DOM dynamically from JavaScript, or possibly have a floating div on the page. I like the implementation www.netflix.com[^] uses when you hover over a movie.

        S Offline
        S Offline
        sishya
        wrote on last edited by
        #3

        Hi, new to DOM .Pls help me out .Is there anyway out other than this.

        N 1 Reply Last reply
        0
        • S sishya

          Hi, new to DOM .Pls help me out .Is there anyway out other than this.

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

          Please lookup Document Object Model (DOM) on MSDN, or elsewhere, for a more thorough discussion. You can access just about any object on the page in the browser window by using JavaScript.function InsertText() { oDiv = document.getElementById('MyDiv'); oDiv.InnerText = 'Hello, World'; } Not proper code, but hopefully you get the idea.

          S 1 Reply Last reply
          0
          • N Not Active

            Please lookup Document Object Model (DOM) on MSDN, or elsewhere, for a more thorough discussion. You can access just about any object on the page in the browser window by using JavaScript.function InsertText() { oDiv = document.getElementById('MyDiv'); oDiv.InnerText = 'Hello, World'; } Not proper code, but hopefully you get the idea.

            S Offline
            S Offline
            sishya
            wrote on last edited by
            #5

            The div tag is not present anywhere in the webform and has to be created on mouseover of the dropdownlist

            N 1 Reply Last reply
            0
            • S sishya

              The div tag is not present anywhere in the webform and has to be created on mouseover of the dropdownlist

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

              insertAdjacentHTML Again, you can find much more info on this and other DOM related functions and properties by researching. The previous post was meant as an example to show the concept not an actual solution.

              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