displaying a div dynamically whereever dropdownlist Box is present above it. [modified]
-
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
-
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
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.
-
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.
-
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. -
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. -
The div tag is not present anywhere in the webform and has to be created on mouseover of the dropdownlist
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.