Solved

Need this div tag

Posted on 2006-07-06
5
161 Views
Last Modified: 2010-04-06
http://www.microsoft.com/windowsmobile/communities/smartphone/default.mspx

on top you have quick links.

I want a similar ability to show list of all of my products when some one takes mouse over or clicks.

0
Comment
Question by:tgatif
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Expert Comment

by:sushestvo
ID: 17060978
0
 

Author Comment

by:tgatif
ID: 17066306
sumthing else
0
 
LVL 15

Expert Comment

by:Daydreams
ID: 17066352
0
 

Author Comment

by:tgatif
ID: 17171810
still not this. something exact similar to what ms has.
0
 
LVL 2

Accepted Solution

by:
ThijsS earned 400 total points
ID: 17397870
<html>

<head>
      <script>
      
      function findPos(obj)
      {
            var curleft = curtop = 0;
            if (obj.offsetParent)
            {
                  curleft = obj.offsetLeft
                  curtop = obj.offsetTop
                  while (obj = obj.offsetParent)
                  {
                        curleft += obj.offsetLeft
                        curtop += obj.offsetTop
                  }
            }
            
            return [curleft,curtop];
      }
      
      function HideDiv(e)
      {
            var TheDivToBeRemoved = document.getElementById("RemoveMe");
            TheDivToBeRemoved.parentElement.removeChild(TheDivToBeRemoved);
      }
      
      function ShowDiv()
      {
            if(document.getElementById("RemoveMe")==null)
            {
                  var TheDiv = document.createElement("DIV");
                  var TheLink = document.getElementById("TheLink");
                  document.body.appendChild(TheDiv);
                  TheDiv.innerHTML = "<p>Anything You want!</p>"
                  TheDiv.id = "RemoveMe";
                  TheDiv.style.border = "2px solid gray";
                  TheDiv.style.background = "white";
                  TheDiv.style.position = "absolute";
                  TheDiv.style.left = findPos(TheLink)[0] + "px";
                  TheDiv.style.top = findPos(TheLink)[1] + "px";
                  TheDiv.style.height = "100px";
                  TheDiv.style.width = "200px";
                  TheDiv.onmouseleave = HideDiv;
            }
      }
      
      </script>

</head>

<body>

<a id="TheLink" onMouseOver="ShowDiv();" href="somewhere">Quick Links</a>

</body>

</html>

The popup-div is fully custumizable in the "ShowDiv" function.
To get a nice layout within the DIV, you might want to use a table.

example:
TheDiv.innerHTML = "<table><tr><td>Product 1</td><td>Product 2</td></tr><tr><td>Product 3</td><td>Product 4</td></tr></table>";
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question