Solved

Need this div tag

Posted on 2006-07-06
5
160 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

729 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