Open Side Menu Go to the Top

05-22-2011 , 06:39 AM
Quote:
Originally Posted by daveT
Here is page 3 of mozillaDocs.

Please read it and tell me how someone with little programming know-how can make dollars or cents of this.

https://developer.mozilla.org/en/Jav..._and_Operators

It's not like I am dismissing the source at page 55. this is page 3. The section on "this" I think is only 5 sentences long, and the stuff later in the docs only gets more confounding. There is absolutely no way a beginner can use this reference.

If you don't know the correct way to write out the basic structure of a javascript, and the correct way to write out the result, or the correct way to see if there is a value assigned to the line of code, how is this the slight bit helpful?
it's not. this kind of resource is only helpful if you already know other programming languages and are familiar with the concepts.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
HTML5/CSS3/advancedJavascript learning and programming logs
150% up to $2,000 Welcome Bonus on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
HTML5/CSS3/advancedJavascript learning and programming logs
05-22-2011 , 02:22 PM
Sorry if I gave the wrong impression of my programming prowess. I always called myself a joke programmer for a reason.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-22-2011 , 08:30 PM
I'm stepping all the way back to page one. This is the issue:

I have the following:

<canvas id....> Your browser does not support Canvas </canvas>

Why is it when I disconnect the javascript, the page loads up without "Your browser does not support Canvas?" There's a huge white space that would suggest that these words ought to be showing up, but I am not sure what is happening here.

Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">


<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!--
<link rel="stylesheet" href="iiHomeCss.css" media="Screen" />

<script src="iiHomeScript.js"></script>
-->

<script type="text/css">

a{
color: black;
}

</script> 

</style>
</head>
<body>

<canvas id="musicCanvas" width="200" height="200">
Your browser does not support the canvas element.</canvas>

<canvas id="writeCanvas" width="200" height="200" style="position: absolute; left: .5em; top: 10em;">
Your browser does not support the canvas element.
</canvas>


<canvas id="webCanvas" width="200" height="200" style="position: absolute; left: .5em; top: 20em;">
Your browser does not support the canvas element.
</canvas>


<div id="main">
<span>

<h1> WELCOME </h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque consectetur eros at nibh vulputate eu posuere nisi laoreet. Quisque ut leo nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam tristique sagittis tortor non lobortis. Etiam auctor sapien eget arcu vestibulum viverra. Maecenas viverra volutpat mauris, euismod tincidunt libero placerat in. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis ligula magna, dapibus id posuere et, vulputate sit amet lectus. In hac habitasse platea dictumst. Mauris justo purus, faucibus dictum facilisis eget, congue ac neque. Vivamus rhoncus nisi et nisi fringilla egestas.

In vel dolor nec massa lobortis tincidunt in a arcu. Sed aliquam sagittis nisl. Etiam bibendum felis sed tortor faucibus pretium dignissim sem tincidunt. Vestibulum facilisis tempor tortor, vel pellentesque ipsum consectetur at. In ut rhoncus tortor. Suspendisse mauris eros, feugiat at pharetra eget, scelerisque sit amet elit. Vivamus mattis pulvinar nisi. Maecenas eu urna vitae mauris scelerisque ornare et quis lorem. Duis sit amet nunc nec eros vehicula placerat a in mauris. Sed rutrum tellus ac ligula pellentesque ultricies. Pellentesque magna mi, vehicula eu suscipit a, viverra eu quam. Praesent vitae libero lorem. Donec eget est quis ante vehicula vestibulum. Mauris iaculis iaculis diam sed elementum. Sed eget nulla tellus, nec scelerisque erat. Ut bibendum euismod tincidunt. Aliquam dui lacus, posuere in convallis id, malesuada vitae eros. Suspendisse tempus lorem eros. Vivamus dignissim lectus in dui mollis aliquet. Vestibulum eu orci ac ligula euismod suscipit et ut felis. Nullam non feugiat turpis. Fusce sit amet rutrum ante. Donec vitae fringilla metus. Suspendisse urna nulla, condimentum et rutrum et, bibendum vel justo. Nullam fermentum feugiat neque sed feugiat. Donec vestibulum mi quis nibh posuere a venenatis sem tristique. Mauris dapibus augue rutrum est imperdiet dapibus. Phasellus ante nibh, ullamcorper at vehicula vel, egestas eget elit. Nam ante metus, suscipit in pellentesque a, malesuada at leo. Duis massa magna, scelerisque id auctor sed, sollicitudin et libero. Sed quis blandit turpis. Fusce vitae urna eget tortor vulputate mollis ullamcorper vitae orci.

Proin a mauris tellus, eget accumsan mi. In hac habitasse platea dictumst. Nulla vestibulum, mauris vel pretium imperdiet, nisl risus eleifend lorem, quis rutrum nibh ante non nulla. Aenean condimentum laoreet augue in adipiscing. Ut tempus, tortor non dignissim interdum, justo velit pulvinar lacus, eu varius nisi nulla eu lectus. Aliquam tempor magna quis lacus tristique adipiscing. Phasellus id varius massa. Ut vel enim nibh, eget faucibus nisi. Pellentesque turpis risus, auctor eget imperdiet vel, vestibulum sed turpis. Nunc sollicitudin ipsum sit amet justo feugiat id tincidunt leo tristique. Mauris eu quam massa. Cras iaculis vehicula arcu mattis sodales. </p>

</span>
</div>

</body>
</html>
I placed the extra script in to test an idea that didn't work out.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-22-2011 , 09:21 PM
Probably because your browser still supports the canvas element regardless if JS is turned on or not. An older browser that does not support the canvas element at all will show that message even if JS is enabled.

If you want to output a specific message for when JS is disabled you should wrap it around a <noscript></noscript> tag. The content between those tags will only load up when JS is disabled.

I never worked with the canvas tag but assuming there's no elegant solution in the documentation you might want to set the width/height of it to 0 and hide it with CSS and then use JS to modify it after page load. This way the user has no idea that the canvas exists when JS is disabled.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-22-2011 , 09:48 PM
Oh, crud: that was stupid.

There must be a difference between turning js off in the head and the user actually having script off. For some reason, I feel like I stated the obvious.

Once I turned on NoScript, I found that the stuff in the tags work out. However, note that this won't work:

<canvas><noscript></noscript></canvas>

it has to be:

<canvas></canvas>

<noscript></noscript>

Excellent, thank you.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-23-2011 , 06:38 PM
An interesting thing to discover here. Not much on the web about how to create a link over a canvas element. There are various solutions to this issue. One involved creating a script so that there is a mouse map over the canvas, so that your mouse, when over ex. x35, y40, that particular area is connected to an anchor link. That I think was processing.js or something like that. SO confuses me sometimes.

That was way to advanced for me, so the other idea is to create a div over div to create a hot area. I took that idea and minimized it. The main code bit is:

(there's the size tags added in by 2+2 I guess from the transfer from the document. I'm not going to delete all of those)

Code:
<canvas id="musicCanvas" width="200" height="200">
 Your browser does not support the canvas element.</canvas>
 

  <a href="#" id="musicLink">link to music</a>
I did attempt to use empty anchor text, but of course the size of the link was to small. In order to create an area large enough to cover the words on the canvas, I just wrote something semi-logical to the cause.

Then hide it, and hide on mouse over, the opacity is a cross-browser solution for IE:

(I know, I should cascade it, but whatever)

Code:
a#musicLink {
     position: absolute;
   background-color: #fff;    
   top: 100px;
   left: 75px;
   opacity: 0;
   filter: alpha(opacity=1);
    
 }
 

 a#writeLink {
     position: absolute;
   background-color: #fff;    
   top: 250px;
   left: 75px;
   opacity: 0;
   filter: alpha(opacity=1);
    
 }
 

 a#webLink {
     position: absolute;
   background-color: #fff;    
   top: 410px;
   left: 75px;
   opacity: 0;
   filter: alpha(opacity=1);
    
 }
 

 a:hover {
   background-color: #ff6;
   opacity: 1;
   filter: none;
 }
and that's my best solution for now. Good to have this as a reference for those who may want to look into this sort of thing.

Code:
<!DOCTYPE html>
 <html lang="en">
 <head>
 <meta charset="utf-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 

 

 <!--[if lt IE 9]>
 <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
 <![endif]-->
 

 

 <link rel="stylesheet" href="iiHomeCss.css" media="Screen" />
 

 <script src="iiHomeScript.js"></script>
 

 </style>
 </head>
 <body>
 

 <canvas id="musicCanvas" width="200" height="200">
 Your browser does not support the canvas element.</canvas>
 

 <a href="#" id="musicLink">link to music</a>
 

 <noscript><a href="//#">Music</a></noscript>
 

 

 

 <canvas id="writeCanvas" width="200" height="200" style="position: absolute; left: .5em; top: 10em;">
 Your browser does not support the canvas element.
 </canvas>
 

 <a href="#" id="writeLink">Link to writing</a>
 

 <noscript><a href="//#">Music</a></noscript>
 

 <canvas id="webCanvas" width="200" height="200" style="position: absolute; left: .5em; top: 20em;">
 Your browser does not support the canvas element.
 </canvas>
 

 <a href="#" id="webLink">Link to Web</a>
 

 <noscript><a href="//#">Writing</a></noscript>
 

 <div id="main">
 <span>
 

 <h1> WELCOME </h1>
 

 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque consectetur eros at nibh vulputate eu posuere nisi laoreet. Quisque ut leo nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam tristique sagittis tortor non lobortis. Etiam auctor sapien eget arcu vestibulum viverra. Maecenas viverra volutpat mauris, euismod tincidunt libero placerat in. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis ligula magna, dapibus id posuere et, vulputate sit amet lectus. In hac habitasse platea dictumst. Mauris justo purus, faucibus dictum facilisis eget, congue ac neque. Vivamus rhoncus nisi et nisi fringilla egestas.
 

 In vel dolor nec massa lobortis tincidunt in a arcu. Sed aliquam sagittis nisl. Etiam bibendum felis sed tortor faucibus pretium dignissim sem tincidunt. Vestibulum facilisis tempor tortor, vel pellentesque ipsum consectetur at. In ut rhoncus tortor. Suspendisse mauris eros, feugiat at pharetra eget, scelerisque sit amet elit. Vivamus mattis pulvinar nisi. Maecenas eu urna vitae mauris scelerisque ornare et quis lorem. Duis sit amet nunc nec eros vehicula placerat a in mauris. Sed rutrum tellus ac ligula pellentesque ultricies. Pellentesque magna mi, vehicula eu suscipit a, viverra eu quam. Praesent vitae libero lorem. Donec eget est quis ante vehicula vestibulum. Mauris iaculis iaculis diam sed elementum. Sed eget nulla tellus, nec scelerisque erat. Ut bibendum euismod tincidunt. Aliquam dui lacus, posuere in convallis id, malesuada vitae eros. Suspendisse tempus lorem eros. Vivamus dignissim lectus in dui mollis aliquet. Vestibulum eu orci ac ligula euismod suscipit et ut felis. Nullam non feugiat turpis. Fusce sit amet rutrum ante. Donec vitae fringilla metus. Suspendisse urna nulla, condimentum et rutrum et, bibendum vel justo. Nullam fermentum feugiat neque sed feugiat. Donec vestibulum mi quis nibh posuere a venenatis sem tristique. Mauris dapibus augue rutrum est imperdiet dapibus. Phasellus ante nibh, ullamcorper at vehicula vel, egestas eget elit. Nam ante metus, suscipit in pellentesque a, malesuada at leo. Duis massa magna, scelerisque id auctor sed, sollicitudin et libero. Sed quis blandit turpis. Fusce vitae urna eget tortor vulputate mollis ullamcorper vitae orci.
 

 Proin a mauris tellus, eget accumsan mi. In hac habitasse platea dictumst. Nulla vestibulum, mauris vel pretium imperdiet, nisl risus eleifend lorem, quis rutrum nibh ante non nulla. Aenean condimentum laoreet augue in adipiscing. Ut tempus, tortor non dignissim interdum, justo velit pulvinar lacus, eu varius nisi nulla eu lectus. Aliquam tempor magna quis lacus tristique adipiscing. Phasellus id varius massa. Ut vel enim nibh, eget faucibus nisi. Pellentesque turpis risus, auctor eget imperdiet vel, vestibulum sed turpis. Nunc sollicitudin ipsum sit amet justo feugiat id tincidunt leo tristique. Mauris eu quam massa. Cras iaculis vehicula arcu mattis sodales. </p>
 

 </span>
 </div>
 

 </body>
 </html>
 

 window.onload=function(){
 

 var c=document.getElementById("musicCanvas");
 var cxt=c.getContext("2d");
 var grd=cxt.createLinearGradient(0,0,175,50);
 grd.addColorStop(0,"#0000FF");
 grd.addColorStop(1,"#000000");
 cxt.fillStyle=grd;
 cxt.beginPath();
 cxt.arc(100,100,50,0,Math.PI*2,true);
 cxt.closePath();
 cxt.fill();
 

 cxt.font = "italic 2em sans-serif";
 cxt.fillStyle = "red";
 cxt.textAlign = "center";
 cxt.fillText("Music", 100, 110);
 

 var c=document.getElementById("writeCanvas");
 var cxt=c.getContext("2d");
 var grd=cxt.createLinearGradient(0,0,175,50);
 grd.addColorStop(0,"#0000FF");
 grd.addColorStop(1,"#000000");
 cxt.fillStyle=grd;
 cxt.beginPath();
 cxt.arc(100,100,50,0,Math.PI*2,true);
 cxt.closePath();
 cxt.fill();
 

 cxt.font = "italic 2em sans-serif";
 cxt.fillStyle = "red";
 cxt.textAlign = "center";
 cxt.fillText("Writing", 100, 110);
 

 var c=document.getElementById("webCanvas");
 var cxt=c.getContext("2d");
 var grd=cxt.createLinearGradient(0,0,175,50);
 grd.addColorStop(0,"#0000FF");
 grd.addColorStop(1,"#000000");
 cxt.fillStyle=grd;
 cxt.beginPath();
 cxt.arc(100,100,50,0,Math.PI*2,true);
 cxt.closePath();
 cxt.fill();
 

 cxt.font = "italic 2em sans-serif";
 cxt.fillStyle = "red";
 cxt.textAlign = "center";
 cxt.fillText("Web", 100, 110);
 

 }
 

 body
 {
 background-image:url('http://i218.photobucket.com/albums/cc208/davidtoomey/smallblot.jpg');
 }
 

 a#musicLink {
     position: absolute;
   background-color: #fff;    
   top: 100px;
   left: 75px;
   opacity: 0;
   filter: alpha(opacity=1);
    
 }
 

 a#writeLink {
     position: absolute;
   background-color: #fff;    
   top: 250px;
   left: 75px;
   opacity: 0;
   filter: alpha(opacity=1);
    
 }
 

 a#webLink {
     position: absolute;
   background-color: #fff;    
   top: 410px;
   left: 75px;
   opacity: 0;
   filter: alpha(opacity=1);
    
 }
 

 a:hover {
   background-color: #ff6;
   opacity: 1;
   filter: none;
 }
 

 

 #main
 {
 position:absolute;
 top:5em;
 left:20em;
 right:5em;
 background-color:blue;
 color:white;
 border-style:solid;
 border-width:10px;
 border-color:black;
 filter:alpha(opacity=10);
 opacity:0.75;
 border-opacity:1;
 border-radius:100px;
 -moz-border-radius:100px;
 padding:2em;
 }
 

 span
 {
 word-wrap:normal;
 }
Yeah, I really used this as my homepage.

Last edited by _dave_; 05-23-2011 at 06:46 PM. Reason: size tags
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-23-2011 , 06:48 PM
Quote:
(there's the size tags added in by 2+2 I guess from the transfer from the document. I'm not going to delete all of those)
copy/paste via notepad to strip such stuff sometimes works if you're coming straight from some other webpage. or use a decent text editor that has find/replace. it's not hard to remove all such things. I just assumed your original text had no mention of [size=1] or [/size]
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-24-2011 , 05:52 AM
This is about the dumbest thing ever created on the web. But at least it wasn't able to be done a few years back.

Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">

<script type="text/javascript">

window.onload=function(){
var c= document.getElementById('thisCanvas');
var ctx=c.getContext('2d');


ctx.moveTo(100, 300);
ctx.bezierCurveTo(50, 50, 300, 50, 300, 100);
ctx.bezierCurveTo(10, 50, 300, 50, 300, 300);
ctx.bezierCurveTo(50, 50, 300, 50, 300, 200);

ctx.strokeStyle="blue";
ctx.stroke();

};

</script>
</head>
<body>

<canvas id="thisCanvas" width="400" height="400">
Your browser does not support the canvas element.
</canvas>

</body>
</html>

Last edited by daveT; 05-24-2011 at 05:53 AM. Reason: hell, yeah, it's going on the website!
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-24-2011 , 07:37 PM
You are learning some of the most obscure things that will not make you a good web programmer. I thought I would mention this before you got too far into it.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-24-2011 , 07:47 PM
Lol ^

True, but if that stuff is what interests you most and motivates, go with it. It might not be the most optimal learning curve but it depends on your objectives and timeframe.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-25-2011 , 04:18 AM
Eh, I sometimes have a hard time staying focused and look at things that are interesting for a short bit. Obviously, creating stupid canvas drawings is not my goal. There is a difference between doing things and creating a page for fun and building a whole site from scratch, thinking about UI and navigation. This new perspective should keep me more focused, especially since I actually have to get content up in a practical time frame.

So.... something more practical may be working on a drop-down list. ?????

It doesn't take a genius to see that I basically did a copy/paste job (from Google's Ground Up series), since this isn't my normal coding style. It is also horrendously ugly to look at, but that is because I don't care at the moment and I'll fix all that up later.

The issue with the list is that it is very long. I want to create a multi-column list that is easier to look at and navigate.

The big hair-tearing discovery is that the </li> closing "subarticles" should enclose the entire list that I want to hide. At least that one didn't take me too long to figure out.

Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">

<title>T.O.C.</title>

<style type="text/css">

body{
width: 960px;
}

#Nav{
width: 200px;
border-bottom: 2px solid green;
background-color: orange;
}

#Nav ul{
list-style: none;
cursor: pointer;
}

#Nav li a{
display: block;
background-color: green;
border: 2px solid white;
text-decoration: none;
}

#Nav li a:hover{
background-color: #333;
color: #fff;
text-decoration: none;
}

#Nav li ul{
display: none;
position: absolute;
padding: 0;
}

#Nav li:hover ul{
display: block;
}

#Nav li li{
float: left;
}


</style>

<script type="text/javascript">

</script>

</head>
<body>

<h1>big words go here</h1>

<div id="Nav">
<ul> 
    <li><a href="#">Main Article:</a></li>
    <li>Subarticles:
    <ul>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">ay</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
        <li><a href="#">a</a></li>
    </ul>
    </li>
</ul>

</div>

</body>
</html>
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-25-2011 , 07:00 PM
Many interesting things to discover:

- Just because it renders correctly while building the page offline doesn't mean that it won't render as a Picasso once it is uploaded to the actual site. I have no idea why that happened.

- I saved my file with a different name last night. I kept on changing things and pressing refresh but nothing changed. I figured there was something going on, so I open the file itself and find that it shows up as empty on the page. Very strange. Maybe the computer was getting tired.

The solution to what I thought of was pretty easy. In order to create a multi-column drop-down list:

Code:
#hardPianoNav li ul ul{
margin-left: 60px;
margin-top: -192px;
}
The issue is of course, that this does not work in IE. It does, but it doesn't render as a nice grid like it would on all the other browsers.

So, how does the forum feel about:

Code:
<!--[if IE]>
<--![endif]>
Apparently this is controversial?

-------------------------------

Starting working on a subdomain of the site. This subdomain is focused on music composers, musicians, etc.

The page layout will be pretty simple, and I am going to use the same CSS for each page. At the bottom of each page, there is going to be a form so that users can leave a comment. I am thinking that I will use XML for this since I don't want to go through and learn PHP or something to get all this working.

Not sure which construct I should use to tie the pages to the XML document:

xForms seems like it is only supposed to be used for the XHTML, but I can't see why that wouldn't work with HTML5.

XSLT/xQuery/xPath is another option. xQuery seems like it can work with SQL databases as well, but I am not sure if a comment field is really appropriate material for databases.

Ideally, I would like to automate the responses so that they post, plus receive an email whenever someone does leave a comment.

Just realized that this is a tall order.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-25-2011 , 07:10 PM
Using conditionals to use different css code depending on the browser is the super standard way of handling browser differences.

You can detect specific versions too with lt/lte/gt/gte thrown into the mix.

[if lt IE 6] ...would be for a version of IE less than 6.

lt = less than
lte = less than or equal
gt = greater than
gte = greater than or equal

There are others too, google for "CSS Conditionals".
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-25-2011 , 07:21 PM
I try to avoid them and use them as a last resort. If you use them, and they are super handy, you will find they can be hard to maintain.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-25-2011 , 08:00 PM
I have no problem with special casing ancient versions of MSIE when a website's target market absolutely needs to work well on those ancient versions.

However these days MSIE 6 use is crashing, as Windows XP use is crashing. So these days it's not something I really do.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-25-2011 , 08:36 PM
fwiw, I'm testing on IE8 right now. XP won't allow you to upgrade to IE9. I'll probably degrade the site to IE6/7, ff3 and leave it at until I get a more modern machine.

I wanted to ask because earlier in this thread someone mentioned not using browser-specific hacks and I'm not sure what qualifies.

So, no one prefers just using a javascript to create the comment sections? Is XML better-suited for this purpose?
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-25-2011 , 11:48 PM
That was me who said not to use browser specific hacks. I just meant to make a site that looked the same in every standard browser and not worry about doing something like rounded corners which might work in every modern browser but depending on how you implemented it, it may have failed in IE6. The goal was to stick to the lowest common denominator.

This way you could see which features work and which do not in the different browsers.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-26-2011 , 12:39 AM
I completed my first drop-down list. I figured out the logic behind the Google coding and reworked it a little bit. Here is the main code with the main stylesheet. Alas: works in all browsers but Opera?

Doing some search, SO linked to this site: http://rafael.adm.br/css_browser_selector/

but it doesn't appear to work.

As far as doing this style of drop-down list, it is much easier to just create a hidden div, but I wondered if this would work. The answer appears to be not really.

the code:

Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">

<title>ii- Music T.O.C.</title>

<link rel="stylesheet" href="musicNorm.css" media="Screen" />

<!--[if IE]>
<link rel="stylesheet" href="musicIE.css" media="Screen" />
<![endif]-->

</head>
<body>

<h1>big words, obv</h1>

<div id="hardPianoNav">
<ul> 
    <li><a href="#">Main Articl</a></li>
    <li id="subArt">Subarticles by Musician:
        <ul> 
        <li><a href="#">Alkan</a></li>
        <li><a href="#">Albeniz</a></li>
        <li><a href="#">Balakirev</a></li>
        <li><a href="#">Barlow</a></li>
        <li><a href="#">Barret</a></li>
        <li><a href="#">Bartok</a></li>
        <li><a href="#">Boulez</a></li>
        <li><a href="#">Bussotti</a></li>
            <ul>
            <li><a href="#">Ferneyhough</a></li>
            <li><a href="#">Finnissy</a></li>
            <li><a href="#">Fox</a></li>
            <li><a href="#">Godowsky</a></li>
            <li><a href="#">Henselt</a></li>
            <li><a href="#">Hoban</a></li>
            <li><a href="#">Ligeti</a></li>
            <li><a href="#">Mareaux</a></li>
                <ul>
                <li><a href="#">Martino</a></li>
                <li><a href="#">Prokofiev</a></li>
                <li><a href="#">Ravel</a></li>
                <li><a href="#">Rzewski</a></li>
                <li><a href="#">Scelsi</a></li>
                <li><a href="#">Scriabin</a></li>
                <li><a href="#">Skalkottas</a></li>
                <li><a href="#">Sorabji</a></li>
                    <ul>
                    <li><a href="#">Shostakovich</a></li>
                    <li><a href="#">Xenakis</a></li>
                    <li><a href="#">Zimmerman</a></li>
                    </ul>
                </ul>
            </ul>

        </ul>
    </li>
</ul>

</div>

</body>
</html>
the css:

Code:
body{
width: 960px;
}

#hardPianoNav li{
list-style: none;
}

#hardPianoNav li a{
display: block;
width: auto;
text-decoration: none;
color: #0000FF ;
}

#hardPianoNav li a:hover{
color: #FF0066;
}

#hardPianoNav ul li#subArt{
list-style: none;
cursor: pointer;
text-decoration: none;
background-color: #0000FF ;
width: 10em;
height: 1.5em;
border: 2px outset #CCCCCC;
color: white;
}

#hardPianoNav ul li#subArt li a{
background-color: #CCCCCC;
width: 5.5em;
border: .3em outset #000033;
}

#hardPianoNav li ul{
display: none;
}

#hardPianoNav li:hover ul{
display: block;
width: 100px;
}

#hardPianoNav li ul ul{
margin-left: 3.5em;
margin-top: -14em;
}
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-27-2011 , 08:26 AM
The exact same style sheet renders differently on different pages. Why is this happening?
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-27-2011 , 08:32 AM
Have you used JSFiddle before btw? http://www.jsfiddle.net

It let's you show people the code in running which is really handy, here's one I saved for you

http://jsfiddle.net/HXfXR/

Quote:
Originally Posted by daveT
The exact same style sheet renders differently on different pages. Why is this happening?
What do you mean exactly?
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-27-2011 , 05:24 PM
Dave you check out this site for pure css dropdown menus:

http://meyerweb.com/eric/css/edge/menus/demo.html

Great resource in general for css.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-27-2011 , 08:28 PM
Same stylesheet, different rendering:





Obviously, one looks better than the other (no logo for me, lol).

The only reason I can think of why this happens is because they are each opening into different subdomains and the server is interpreting them differently.

The other issue is equally confounding: when I view the better-looking page on a larger screen, the header turns into a Picasso. The ugly header stays in perfect shape.

The solution I thought of is:

-- create a css reset with different settings.

or

-- change the header completely.

But architecturally, I want the opening page on each subdomain to look the same, so that when you toggle back and forth, the only thing that changes is the content, not the header.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-27-2011 , 09:00 PM
Okay, fine. If you were going to blame that issue on me, you are correct.

Basically, code late at night, create a piece of garbage. Code earlier in the day and fix everything.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-28-2011 , 12:41 AM
Quote:
Originally Posted by daveT
Same stylesheet, different rendering:





Obviously, one looks better than the other (no logo for me, lol).
They both make me think you are a 14 year old girl. But seriously, pink and yellow?
HTML5/CSS3/advancedJavascript learning and programming logs Quote
05-28-2011 , 06:28 AM
Didn't I mention that I am selling teddy bears on my site?

I don't like how those pages are turning out at all. I painted myself into a bad design corner or something. Maybe they aren't too ugly and I am being hard on myself, but they simply aren't up to the standard of the other pages I have created.

If these are supposed to be the openers to subdomains, they should make the user want to continue looking. At this point, I'm not thrilled with my work.
HTML5/CSS3/advancedJavascript learning and programming logs Quote
HTML5/CSS3/advancedJavascript learning and programming logs
150% up to $2,000 Welcome Bonus on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
HTML5/CSS3/advancedJavascript learning and programming logs

      
m