| |
| |
| |
|
Page: 1 2 3 4
Comments:
<NeoFu7ure> http://www.neofuture.co.uk/media/index.php?filename=audio2.mp3 <Delistick> I am trying to make a menu that changes the background color of the item clicked to blue while the rest remain white. <Delistick> My link for a menu item is: <a href="javascript:newsCat(\'tech\');" onClick="changeBkgrnd(this)" id="3"><b>Tech</b></a> <Delistick> that is the 3rd menu item , hence id="3" <Delistick> the function changeBkgrnd(thisitem) has a for loop for each menu item and a IF ELSE statement in it <Delistick> what condition would be in the IF (condidtion) statement? <ht312> hmm, that <a> look horrible <Delistick> well it calls two functions <Delistick> I am working on the onClick one to change the background color <Delistick> any ideas on how to write the function? <ht312> you can simply call changeBkgrnd in newsCat <Delistick> but I need to reset all the others back to white <Delistick> that is the problem <Delistick> I am having difficulty writing the changeBkgrnd function, can you help? <ht312> i try to tell how to call 2 function first. <Delistick> ok <ht312> usually, you don't need to loop, just check track what one is clicked last time, and swap back the bg <Delistick> ht312 how would I do that though? <ht312> var _global_last_activeClicked =null; everytime you call newsCat, check if _global_last_activeClicked is null, if not, do something, then set _global_last_activeClicked to the current item <Delistick> woah, I am a JS noob <Delistick> so I am still learning <Delistick> I am coming from PHP <ht312> js is just like other programming language, how to do stuff effectivily <Delistick> yes I am realizing that <ht312> the proper term will be you are an ui/event driven programming noob. ;) <Delistick> yes <Delistick> thanks <Delistick> http://www.gabbr.com/beta/index.php can you take a look at my code? <Delistick> the News to Gabb menu is what I am trying to fix <Delistick> if someone clicks "popular" I want that menu background to change to blue <Delistick> I have partially written the function in the <script> <Delistick> I just cant get the if(condition) right <NeoFu7ure> i hate uploding large files ffs <ht311> Delistick, the easiest way will be id your link with "newslink_blah", when changeBg can call document.getElementbyId("newslink_" + somevar) ..... <ht311> plus the global var thing i mention in the top, it will work <Delistick> ok will try it <Delistick> trying it.. <Delistick> ht311, like this? http://www.phpriot.com/2678 <ht311> http://www.html-channel.com/pastebin.php?id=3 <deltos> Hey folks...I have a table with two columns. The rightmost column contains an iframe which loads pages selected from the leftmost column (id=sidebar). I want the row height to resize itself on each load (so there is only a scrollbar for the page, not the iframe). <deltos> The following script works in Firefox, but not IE. Any ideas why? <body id="bcontents" onLoad="parent.document.getElementById('sidebar').height=document.body.scrollHeight;"> <NeoFu7ure> scrollHeight ? <NeoFu7ure> (just a guess) <Delistick> how do you changed the background color of a <a href="javascript:newsCat(this)" id="1"> ? <Delistick> in the function newsCat()? <NeoFu7ure> document.getElementById("1").style.backgroundColor="red"; <Delistick> Neo, thanks <Delistick> damn that doesnt work either <Delistick> here is my function that I am trying to make to change the bkground color of the clicked menu item to blue <Delistick> <Delistick> http://www.phpriot.com/2679 <Delistick> can someone help me with this function? <ht311> hi fb <grazzy> going nuts here, table_reference.appendChild(tr_reference); < works fine in fx - ie needs table_reference.childNodes[0].appendChild(tr_reference); to work <grazzy> best way to deal with it? <grazzy> ofcourse it doesnt work the otherway around in fx <ht311> the later way shoudl work in both <ht311> ever heard of tbody? <ht311> i am suprise that ff there is no tbody in FF <ht311> hmm, is time to take my pills <grazzy> hmm <grazzy> you're saying.. .. ? <grazzy> should i reference the tbody instead? <grazzy> and yeah i heard of it, but i seldom use it ;) <grazzy> when i add a tbody <grazzy> it works in ie (again) but not in firefox.. <grazzy> but, if i change the index, to 1 it works in firefox but not ie :) <ht311> the different of white space handling <ht311> in ff , it could be a text node at 0 <grazzy> so whats a good solution? reference the tbody? <grazzy> yay, that worked <grazzy> thanks <ht311> mytable.getElementsByTagName("tbody").item(0); <ht311> http://developer.mozilla.org/en/docs/Traversing_an_HTML_table_with_JavaScript_and_DOM_Interfaces <grazzy> cool, thanks <grazzy> awesome url ;) <[Torgo]> *BOOM* <marquee> <fatbrain> heh <ht311> fb: the IT Crowd is fine <ht311> quite funny even are common IT joke <fatbrain> ok <fatbrain> dl'ing <furtive> dling what <furtive> ah, that show <fatbrain> ya. <fatbrain> only found 2ep. <ht311> there is only 2 ep <ht311> 3rd is coming out <NeoFu7ure> oooh it crowd ep3 out yet ? <NeoFu7ure> yeah friday <NeoFu7ure> might be on ch4 site tho <ht311> yup, on ch4 site <ht311> but there is no Jack Bauer there (yet) <fatbrain> hehe <NeoFu7ure> starst this week in the UK on skyOne <NeoFu7ure> mms://edge.channel4.com/theitcrowd/episode3.wmv <NeoFu7ure> a**** the link dont work <NeoFu7ure> http://www.neofuture.co.uk/media/index.php?filename=audio2.mp3 <NeoFu7ure> this is somat else i do <NeoFu7ure> Music <marquee style="font-size:xxx-large;color:hotpink"> <NeoFu7ure> yeah yeah yeah im using a marquee so what <ht311> you really using one? omg <ht311> what kind of feature is that? you seem to have a lot of time on hand :D <NeoFu7ure> yeah i was lazy putting that media player together, come on it only took me 2 hours to do it all <NeoFu7ure> like my %age bar lol <ht311> there is no seek function with that, not l337 enough ;) <NeoFu7ure> i couldnt work out how to do a "you clicked on % of the table" <NeoFu7ure> if i could i could do it <ht311> i think you could .... <NeoFu7ure> show me how then (demo time) <NeoFu7ure> Jack Bauer can get MacDonalds breakfast after 10:30 <furtive> lol <ht311> currentPosition , take a value with second, you cna get total time and compute the second by where it clicked <ht311> i think you can actually display just the seek bar of the media player <ht311> Jack Bauer removed the "Escape" button from his keyboard. Jack Bauer never needs to escape. <ht311> bored <NeoFu7ure> nah you cant show just the seek bar <NeoFu7ure> tools or nuffin <NeoFu7ure> [02:40] <ht311> currentPosition , take a value with second, you cna get total time and compute the second by where it clicked <NeoFu7ure> huh <NeoFu7ure> i done the bar calc i need to know wht % in a table been clicked to calculte it back to current pos <NeoFu7ure> "you clicked at 77% of the table" <ht311> that is your problem, not the media player <NeoFu7ure> yeah <ht311> and you should know how to get it :D <NeoFu7ure> currentPosition is writable <NeoFu7ure> i been up for 4 days straight im brain fried <NeoFu7ure> im not good with clicky working stuff out stuff <ht311> go sleep, you are nuts, and spend 2 hours on this toy instead of watching 24 or sleep <NeoFu7ure> sleep is for the weak <ht311> event.offsetX , clientX .... should work, since you start from 0 anyway, can cheat on calculation <NeoFu7ure> awe you made me code it <ht311> nope <ht311> you know that you going to do it when you start asking that :D <ht311> I want to stay home tomorrow.. getting cold agian <furtive> we can hang out all day, talk, do our hair <NeoFu7ure> done <NeoFu7ure> http://www.neofuture.co.uk/media/index.php?filename=audio2.mp3 <<===--- working seek bar to amake me more 1773 in ht`s book <NeoFu7ure> 1773 lol <NeoFu7ure> i dont wana be 1337 1773 is a bigger number
Return to
#javascript or Go to some related
logs:
tutacamen #java #linuxhelp psybnc arhive for free bsd local root xploit for fedora core 4 mutilated dicks #php #php heidi clum #skype
|
|