CSS popup window

westis
avatar
rank Regular

Regular


Posts: 47
Joined: 2005-07-02

I'm looking into ways of creating a popu window without Javascript. I looked at Eric Meyer's pure popup css, that shows a "popup" on hover. But is there any way of showing a popup window when a link is clicked?

I don't want a traditional Javascript popup window, but simply something that popups next to the news item (in this case) that is clicked. Something similar to the Javascript popup window in this calendar:
www.dynarch.com/projects/calendar

It's often irritating with Javascript popups, they need to be clicked to be closed and some people have turned off Javascript in their browsers.

I'd like it implemented on this page: http://www.oppnakanalen.se/vaxjo/ny-default.asp

Any tips?

thepineapplehead
thepineapplehead's picture
rank Guru

Guru


Posts: 9199
Joined: 2004-06-30
Location: Milton Keynes

CSS popup window

There is the :active link state, which is when the link has been clicked. Maybe you could use this to display the popup?

Anonymous
Anonymous's picture
rank Guru

Guru


Posts: 29
Joined:
Location: ewn

CSS popup window

Or you could just go ahead and use the DOM for behavior. Smiling

westis
westis's picture
rank Regular

Regular


Posts: 47
Joined: 2005-07-02

CSS popup window

Oh, that was a difficult one. DOM? I know from Googling that is stands for Document Object Model, but that's about it. Doesn't it mean I'm still using Javascript and DHTML?

wolfcry911
wolfcry911's picture
rank Guru

Guru


Posts: 2983
Joined: 2004-09-01
Location: MA, USA

CSS popup window

Yes, but that's what it's for. Have you looked into iframe?

Anonymous
Anonymous's picture
rank Guru

Guru


Posts: 29
Joined:
Location: ewn

CSS popup window

westis wrote:
Oh, that was a difficult one. DOM? I know from Googling that is stands for Document Object Model, but that's about it. Doesn't it mean I'm still using Javascript and DHTML?
Yes.

Use XHTML for markup.
Use CSS for layout.
Use DOM for behavior.

Don't use XHTML for layout.
Don't use CSS for behavior (although some may argue that :hover is behavior but that is debatable). Smiling

It is a cool exercise to try the eric meyer method but javascript and the DOM is there for a reason and this is it. Smiling :)

westis
westis's picture
rank Regular

Regular


Posts: 47
Joined: 2005-07-02

CSS popup window

Ok, I'll go for DOM then and try to learn how to create a popup that is connected to the current window and isn't opening in it's own independent window (iframe?). Only that it might leave out some users with Javascript disabled.

Or do you have any other idea how to show more information about a news item when the news heading is clicked?

I might instead make a page that shows news details in the main box and the latest news headings in the right box. The problem might be that there's no space in the main menu for another heading, as there's currently no heading for News. I might solve it by creating a "back" link in the right column together with the news headings.

But all this might be difficult to grasp if you don't read Swedish, which is the language of the page... Puzzled

Thanks for all the advice!

thepineapplehead
thepineapplehead's picture
rank Guru

Guru


Posts: 9199
Joined: 2004-06-30
Location: Milton Keynes

CSS popup window

Quote:
Or do you have any other idea how to show more information about a news item when the news heading is clicked?

Yes, go to a page with the news story on :roll: