Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 02-16-2011, 05:20 PM Pure Css Popup...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Hi,

Can someone show me how to (if possible) remove the javascript from this code so that it will be pure css code? I figured if there were a script in pure css, that would mean no javascript.

Code:
<html>
<head><title>Popup Window in Pure CSS</title>
<style type="text/css">
#container {
    float:left;
    width:100%;
}
#col1 {
    
    float:left;
    width:auto;
    background:red;
    border-style: solid;
    border-width: 1px;
    padding: 5px;
}
#col2 {
    
    float:left;
    width:auto;
    background:yellow;
    margin-left: 7px; 
    margin-right: 7px; 
    border-style: solid;
    border-width: 1px;
    padding: 5px;
}
#col3 {
    
    float:left;
    width:auto;
    background:green;
    border-style: solid;
    border-width: 1px;
    padding: 5px;
    margin-bottom: 5px;}

</style>
</head>

<body>
Click <a onmouseover='this.style.cursor="pointer" ' onfocus='this.blur();' onclick="document.getElementById('PopUp').style.display = 'block' " ><span style="text-decoration: underline;">here</span></a>

<div id='PopUp' style='display: none; position: absolute; left: 100px; right: 100; top: 50px; border: solid black 1px; padding: 10px; background-color: rgb(255,255,225); text-align: justify; font-size: 14px; width: auto;'>

Banners are categorized by their dimensions. Choose a dimension below to browse those banners:
<p />

<div id="container">

<div id="col1">
<a href="">Link</a><br />
<a href="">Link</a><br />
<a href="">Link</a><br />
<a href="">Link</a><br />
<a href="">Link</a><br />
</div>

<div id="col2">
<a href="">Link</a><br />
<a href="">Link</a><br />
<a href="">Link</a><br />
<a href="">Link</a><br />
</div>

<div id="col3">
<a href="">Link</a><br />
<a href="">Link</a><br />
<a href="">Link</a><br />
<a href="">Link</a><br />
</div>

<div style='text-align: right;'>
<a onmouseover='this.style.cursor="pointer" ' style='font-size: 14px;' onfocus='this.blur();' onclick="document.getElementById('PopUp').style.display = 'none' " >
<span style="text-decoration: underline; text-valign: ;">Close</span></a></div>
</div>

</body>
</html>
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-16-2011, 05:56 PM Re: Pure Css Popup...
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You cannot have a "script" in pure CSS as CSS has no scripting capabilities

AND there is no CSS equivalent to the "onClick" or the "onBlur" events.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-16-2011, 06:01 PM Re: Pure Css Popup...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Well then, would there be an exception, so that if someone has javascript disabled, they would still be able to see the contents of that script?

Thanks Chris
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 02-16-2011, 06:14 PM Re: Pure Css Popup...
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Nope because it's hidden by default.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-16-2011, 06:23 PM Re: Pure Css Popup...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
i was afraid of that. Hey Chris, how popular is Javascript these days? Do you think alot of people have it enabled?
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 02-16-2011, 06:56 PM Re: Pure Css Popup...
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
simplest way around it is to open the document with the elements visible, then hide them with javascript with a script that triggers after the </body> element
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-16-2011, 08:33 PM Re: Pure Css Popup...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Thanks, but I *think* I am going to use a different approach. Have to think of it first though, that's the thing...
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 02-16-2011, 10:11 PM Re: Pure Css Popup...
Marik's Avatar
Skilled Talker

Posts: 99
Trades: 0
Very few have js disabled:

http://stackoverflow.com/questions/1...ble-javascript

read the 1st post, it's rather outdated so I would assume even less have is disabled nowadays. I personally wouldn't think twice about supporting js disabled folks. There are more ie6 users than there are js disabled users.
__________________

Please login or register to view this content. Registration is FREE

Last edited by Marik; 02-16-2011 at 10:12 PM..
Marik is offline
Reply With Quote
View Public Profile
 
Old 02-17-2011, 09:55 PM Re: Pure Css Popup...
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
There are pure css popups and tool-tips that might do what you want. You will be "up-to-date" browser limited of course.
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 02-18-2011, 12:21 AM Re: Pure Css Popup...
Experienced Talker

Posts: 35
Trades: 0
Hi,
How can a pop can come without a java script,
you have used java script in your code so this cannot
be a pure css pop up any pop up cannot be a css pop up because because
we must use script to make it appear when any event is triggered
__________________
Magento Themes Experts

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
shankar.adodis is offline
Reply With Quote
View Public Profile
 
Old 02-18-2011, 11:38 PM Re: Pure Css Popup...
shivaji's Avatar
Ultra Talker

Posts: 321
Trades: 0
Quote:
How can a pop can come without a java script,
Actually this is not standard popup. This is a:hover with -999px definition. With mouse over you get visible element.
__________________

Please login or register to view this content. Registration is FREE
- uncommon free scripts

Please login or register to view this content. Registration is FREE
- Städte, Sport, Party, Gourment, Apartments, Hotels
shivaji is offline
Reply With Quote
View Public Profile Visit shivaji's homepage!
 
Reply     « Reply to Pure Css Popup...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 3.85192 seconds with 12 queries