What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » am i blind?

am i blind?
Author: Message:
Supersonicdarky
Veteran Member
*****

Avatar

Posts: 2317
Reputation: 48
– / – / Flag
Joined: Feb 2005
Status: Away
O.P. am i blind?
there's obviously something wrong here that i am not seeing >.<

code:
<html>
    <head>
        <title>Moo</title>
       
        <style type="text/css">
       
            a {
                color: #666;
                text-decoration: underline;
                font-weight: normal;
            }
       
            #box {
                width: 400px;
                padding: 15px;
                border: 1px #333 solid;
                background: #ccc;
                margin: 15px;
            }
           
            #box h1 {
                font-size: 24px;
                margin: 5px;
            }
           
            #box p {
                margin: 5px;
                font-size: 14px;
                line-height: 1.4;
            }
           
            #box p span {
                border-bottom: 1px #666 dotted;
            }
       
        </style>
       
        <script language="javascript">
       
        function fontsize(px) {
            document.getElementById('foo').style.font-size=px;
        }
       
        </script>
       
    </head>
   
    <body>
   
        <h3>Font Size: <a href="#" onClick="fontsize('12px')">Small</a> | <a href="#" onClick="fontsize('16px')">Medium</a> | <a href="#" onClick="fontsize('20px')">Large</a></h3>
   
        <div id="box">
            <h1>Box 1</h1>
            <p>Maecenas dapibus mi non nunc. <span id="foo">Curabitur</span> sed ipsum feugiat tellus ultricies accumsan. Integer pretium, orci sit amet ultricies blandit, augue felis volutpat enim, ut sodales lacus diam et sapien. Phasellus pellentesque. In fringilla ante id magna <span id="foo">commodo</span> dictum. Maecenas dapibus malesuada neque. Morbi tincidunt augue eu ligula. Donec dignissim. Etiam rhoncus. Nam id sapien. Pellentesque auctor venenatis massa. Donec eleifend sodales orci. Mauris non mauris. Quisque non velit.</p>
        </div>
       
        <div id="box">
            <h1>Box 2</h1>
            <p>Etiam in justo. Fusce ut mi at justo aliquet <span id="foo">cursus</span>. Cras orci felis, iaculis nec, placerat vulputate, sollicitudin fermentum, nibh. Nullam accumsan enim et velit. Integer arcu turpis, congue et, fermentum quis, tincidunt sed, ipsum. Proin sagittis varius mi. In mollis placerat mi. Duis ornare sem ut lectus. Donec porttitor sollicitudin neque. Quisque aliquet. Sed ornare. <span id="foo">Nunc</span> varius. Morbi pretium est non lectus.</p>
        </div>
       
    </body>
</html>

nothing happens when i click the font size links >.<

This post was edited on 07-07-2007 at 01:42 AM by Supersonicdarky.
07-07-2007 01:35 AM
Profile E-Mail PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: am i blind?
style.font-size
style.fontSize
07-07-2007 01:46 AM
Profile PM Web Find Quote Report
Supersonicdarky
Veteran Member
*****

Avatar

Posts: 2317
Reputation: 48
– / – / Flag
Joined: Feb 2005
Status: Away
O.P. RE: am i blind?
w3wt!

but it only changes size of first <span></span> =/
07-07-2007 01:53 AM
Profile E-Mail PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: am i blind?
Yeah, id attributes need to be unique, so you can't have two elements with id="foo" on the same page.

You could change id="foo" to class="foo" and then use a loop like this to go through them all...

code:
function fontsize(px) {
    var spanElements = document.getElementsByTagName('span');
    for(var i = 0; i < spanElements.length; i++) {
        if(spanElements[i].className == 'foo') {
            spanElements[i].style.fontSize = px;
        }
    }
}
07-07-2007 02:22 AM
Profile PM Web Find Quote Report
Supersonicdarky
Veteran Member
*****

Avatar

Posts: 2317
Reputation: 48
– / – / Flag
Joined: Feb 2005
Status: Away
O.P. RE: am i blind?
w3wt!

* Supersonicdarky sexes dz w/out protection

8-)

---

test

&#12398;

&#12364;

&#12399;

&#12392;

&#12395;

&#12434;

This post was edited on 07-07-2007 at 02:59 AM by Supersonicdarky.
07-07-2007 02:55 AM
Profile E-Mail PM Find Quote Report
Voldemort
Veteran Member
*****

Avatar

Posts: 3504
Reputation: 49
– / – / Flag
Joined: Jul 2005
Status: Away
RE: am i blind?
ewww
no unicode
*All posts are a purely speculative hypothesis based on abstract reasoning.
Not my daughter, you bitch!
[Image: ico-mollytrix16.gif]
07-07-2007 03:15 AM
Profile E-Mail PM Find Quote Report
Supersonicdarky
Veteran Member
*****

Avatar

Posts: 2317
Reputation: 48
– / – / Flag
Joined: Feb 2005
Status: Away
O.P. RE: am i blind?
i know, i pasted unicode here so it would get converted
07-07-2007 03:17 AM
Profile E-Mail PM Find Quote Report
Voldemort
Veteran Member
*****

Avatar

Posts: 3504
Reputation: 49
– / – / Flag
Joined: Jul 2005
Status: Away
RE: am i blind?
ahaha
*All posts are a purely speculative hypothesis based on abstract reasoning.
Not my daughter, you bitch!
[Image: ico-mollytrix16.gif]
07-07-2007 03:24 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On