purplesoup
asked on
how does the css code work in this example?
I'm looking at this example
http://jsfiddle.net/fwQeu/
I'll paste the code below. I can't see how the css works - does it? Where is the log class? I'm guessing it is meant to control the height and width of the iframe but the frame doesn't have any class specified does it?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.cs s">
<style type='text/css'>
.log {
width: 400px;
height:200px;
}
</style>
<script type='text/javascript'>//< ![CDATA[
$(window).load(function(){
$(".logfile").click(functi on(){
var button = $(this);
if (button.text()=='+') {
button.text('-');
$('<iframe src="http://www.bbc.co.uk/?logifile=1.log"></iframe>').appendT o(button);
}
else {
button.text('+');
}
});
});//]]>
</script>
</head>
<body>
<h1>this is a test</h1>
<a class="logfile" href="#">+</a><br />
<a class="logfile" href="#">+</a><br />
<a class="logfile" href="#">+</a><br />
</body>
</html>
http://jsfiddle.net/fwQeu/
I'll paste the code below. I can't see how the css works - does it? Where is the log class? I'm guessing it is meant to control the height and width of the iframe but the frame doesn't have any class specified does it?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.cs
<style type='text/css'>
.log {
width: 400px;
height:200px;
}
</style>
<script type='text/javascript'>//<
$(window).load(function(){
$(".logfile").click(functi
var button = $(this);
if (button.text()=='+') {
button.text('-');
$('<iframe src="http://www.bbc.co.uk/?logifile=1.log"></iframe>').appendT
}
else {
button.text('+');
}
});
});//]]>
</script>
</head>
<body>
<h1>this is a test</h1>
<a class="logfile" href="#">+</a><br />
<a class="logfile" href="#">+</a><br />
<a class="logfile" href="#">+</a><br />
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER