Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I don't even know how to title this!

Featured Replies

OK. I am VERY new. Working on my very first website right now. The website is mylilprincessparty.com and I am needing help on my 'Party Packages' page. I want to have 3 images either at top or on side (havent decided) labeled 'Package #1', 'Package #2', and 'Package #3'. I then want to be able to hover on the chosen 'Package' and have the package description appear in the center of the page. And then you hover on a different package for its description to appear and take the place of the first package description. Like a menu. I hope I explained this enough :blush1:

 

Thanks in advance for any help at all and let me know if I need to provide any further information to be more clear!! :D

That could be a hover-popup (no javascript) or a tooltip (which often uses javascript, so won't show for people with javascript disabled; google javascript tooltips or jQuery tooltips)

 

 

For a hover popup example see item 1 here:-

http://www.wickham43.net/hoverpopups.php

 

The text below item 2 describes how to get all the popups in the same place (as shown in item 2).

  • Author

OK, this looks like what I need. I am gonna study up on it now and try to put it into effect :) THANK YOU!!!!

 

I'll definitely +1 you :):drinks:

Righty ho....this is a Javascript job.

 

Put this in the html head on the page:

<script type="text/javascript">
var oldID = 'p1_text';	// sets default visible package text
function makeVis(newID) {
   if(oldID != newID){
       document.getElementById(oldID).style.visibility = "hidden";
       document.getElementById(oldID).style.height = "0px";
       document.getElementById(newID).style.visibility = "visible";
       document.getElementById(newID).style.height = "auto";
	oldID = newID;
   }
}
</script>

 

Add this to your CSS:

.hide {
visibility:hidden;
height:0px;
}

 

And heres some guide html to get it working:

<p>
   <a href="#" onclick="makeVis('p1_text')">Link 1</a>
   <a href="#" onclick="makeVis('p2_text')">Link 2</a>
   <a href="#" onclick="makeVis('p3_text')">Link 3</a>
</p>
<div id="p1_text">Text for Package #1</div>
<div id="p2_text" class="hide">Text for Package #2</div>
<div id="p3_text" class="hide">Text for Package #3</div>

 

Doing it this way means that the text for all the packages will always be present on the page & can be seen by search engines. An alternative way to do this would be to replace the text....but the search engines wouldn't be able to see the text for the 2nd & 3rd links.

 

If you change the div ID names, make sure that you set the first visible one in the javascript at the top to match.

  • Author

Righty ho....this is a Javascript job.

 

Put this in the html head on the page:

<script type="text/javascript">
var oldID = 'p1_text';	// sets default visible package text
function makeVis(newID) {
   if(oldID != newID){
       document.getElementById(oldID).style.visibility = "hidden";
       document.getElementById(oldID).style.height = "0px";
       document.getElementById(newID).style.visibility = "visible";
       document.getElementById(newID).style.height = "auto";
	oldID = newID;
   }
}
</script>

 

Add this to your CSS:

.hide {
visibility:hidden;
height:0px;
}

 

And heres some guide html to get it working:

<p>
   <a href="#" onclick="makeVis('p1_text')">Link 1</a>
   <a href="#" onclick="makeVis('p2_text')">Link 2</a>
   <a href="#" onclick="makeVis('p3_text')">Link 3</a>
</p>
<div id="p1_text">Text for Package #1</div>
<div id="p2_text" class="hide">Text for Package #2</div>
<div id="p3_text" class="hide">Text for Package #3</div>

 

Doing it this way means that the text for all the packages will always be present on the page & can be seen by search engines. An alternative way to do this would be to replace the text....but the search engines wouldn't be able to see the text for the 2nd & 3rd links.

 

If you change the div ID names, make sure that you set the first visible one in the javascript at the top to match.

 

OK, I'm still playing around with this one. I changed 'onclick' to 'onmouseover' and got more of what I wanted. I dont want the labels to be linked though. Also, I plan on having the 'Pkg1', 'Pkg2', and 'Pkg3' labels be images that you mouseover and not just text. Will this change the code completely? Thanks for the help!

OK, I'm still playing around with this one. I changed 'onclick' to 'onmouseover' and got more of what I wanted. I dont want the labels to be linked though. Also, I plan on having the 'Pkg1', 'Pkg2', and 'Pkg3' labels be images that you mouseover and not just text. Will this change the code completely? Thanks for the help!

 

They don't need to be links - it can be any html tag with a mouseover or onclick.

 

Again the contents of the containers to be shown/hidden can be anything as long as the containers have an ID.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.