Solved

css for closing popup

Posted on 2014-09-11
5
110 Views
Last Modified: 2014-09-29
how do I add a simple css to close popup windows?  The 3 product images (models ae, be and bte) in the chart open in a new window on click (added behavior).  I would like to have the little "x" in top right corner to allow for someone to easily close window.  Maybe that is something that I should do in behaviors?

http://nsitedesigns.com/nsitedesigns/freshflo/pond.html
0
Comment
Question by:nsitedesigns
5 Comments
 
LVL 22

Accepted Solution

by:
plusone3055 earned 500 total points
ID: 40317256
may i ask why you need CSS to do it when the user can simply click the X in the browser to close it. It seems like overkill ???
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40317259
I must be missing something it closes when you click the x already.  That is the default. Are you wanting something different?

Cd&
0
 

Author Comment

by:nsitedesigns
ID: 40317329
Yeah, I guess you both are correct.  THe little X is just kinda cool.  If I could figure that out, I would remove the menu bar.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40319877
Well instead of using popups which get blocked by users who use a popup blocker; why not use a div and then use a couple of CSS classes to show/hide the popup?  Then you can use whatever markup you want to do layout and style.  The x is just an icon with ckick event.

Cd&
0
 
LVL 42

Expert Comment

by:Chris Stanyon
ID: 40320286
Hey there,

First off, CSS is not really capable of closing or opening anything - it's for presentation. If you want your pages to 'do' something, then you'll need to look at Javascript (jquery etc).

Secondly, opening a new window to show an image like that was popular back in the 90's but I haven't seen it done like that for such a long time. I can't believe DreamWeaver still produces code like that!

As Cd said, popups like this will often get blocked, so you're better off keeping everything 'in-page'. This is commonly called a lightbox effect, and a quick search around will point you to some javascript/css solutions - either as full packages you just include in your page, or tutorials showing you how to roll your own. It's not really that difficult

Not only will this look and feel much better, but your visitors will appreciate it a lot more - nothing more annoying than a site that opens extra windows.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Select2 jquery help 9 46
Return data with AJAX, JQUERY and PHP 13 38
modify h2 4 16
push text up below h2 tag 1 8
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now