Latest Uploads
image-15-0 ... -19-40.jpg

Jayenkai

image-15-0 ... -20-07.jpg

Jayenkai

Bumble Bee

dna

Tires

dna

Guess The Remake

rychan

Julia Set Visualer

Andy_A

Forum Home

Changing style with javascript = fail :(

UserMessage
Posted : Saturday, 20 August 2011, 07:23 | Permalink
spinal


Below you will see a crude attempt at a page for outputting css code for corner radii (with preview). It works fine in chrome, but fails completely in firefox (currently untested in safari), even though, as far as I can tell I am using the correct method for changing the corners from javascript.

-->
The above code, appears to do absolutely nothing at all, even though according to many online sources, it is the correct way to accomplish the task.

-->

Why can all browsers just stick to the same standard?!!

-----
Download "Don't Flip Out!" Directly to your OUYA! (Click Here).
Homepage : http://spinalcode.co.uk
Posted : Saturday, 20 August 2011, 10:14 | Permalink | Mark Here
CodersRule


And class, this is why we use jQuery.
Homepage : http://tacosareawesome.com/
Posted : Thursday, 25 August 2011, 17:06 | Permalink | Mark Here
HoboBen


WW Entries : 9
Did you manage to fix this in the end? I had a look but couldn't see anything obviously wrong.

From Firefox 4 (Gecko 2.0), you can (see notes) use CSS3 border-radius as normal - does getting rid of the MozBorderRadius code completely work?

-----
Posted : Thursday, 25 August 2011, 17:20 | Permalink | Mark Here
JL235


WW Entries : 7
I've just had a quick look.

Solution 1

It seems that mozBorderRadius does not work via JavaScript. This is probably because it now supports 'borderRadius', which is the proper way to set this.

In FireFox, any valid style appears to return an empty string, "". This means you can test if a style is value by using:
-->
... or better ...
-->

So my advise is to try:
-->
I've not tested the above, but something similar to that, should work ok in FireFox. I'm testing if each of the arguments given is undefined, and the moment I find one that is not, I set the value and return.

However it would not surprise me if WebKit and IE work entirely differently.

Solution 2

-->
^ jQuery, end of.

-----
PlayMyCode.com - build and play in your browser, Blog, Twitter.
Homepage : http://www.StudioFortress.com
Latest Posts
What Have You Done - August 2014
Afr0 Thu 15:31
Hello Kitty
rychan Thu 14:47
Depressingly Popular...
rychan Thu 14:41
Archos Gamepad Tablet 2
rychan Thu 14:40
phpBB *RANT*
rychan Thu 14:35
Little Lever News
Jayenkai Thu 04:29
AGameAWeek Progress Report
Jayenkai Tue 08:46
Ice Bucket Stuffs
steve_ancell Mon 13:40
RIP : Richard Attenborough
steve_ancell Sun 17:45
MS vs Apple
Afr0 Sun 13:16
More

Latest Items
Showcase : Space Rocket Adventurers
HoboBen Thu 16:56
Blog : Health Update : August 2014
Jayenkai Sat 11:31
Blog : 20 Years Ago....
Jayenkai Sat 09:17
Techy : Back from Game Dev Con!
Jayenkai Sun 16:52
Family : Sunday
Jayenkai Wed 03:31
Family : Good News (for once)
Kuron Tue 15:37
Showcase : Don't Tap The Zombies
therevillsgames Mon 16:26
Showcase : Mutant Monty
steve_ancell Wed 19:26
Blog : Update
Kuron Mon 13:52
Techy : New Laptop!?
Kuron Fri 15:52
Showcase : Ascension 2 Live Wallpaper
CodersRule Fri 13:48
Showcase : Saviors of Gundthor
CodersRule Fri 12:50
Showcase : Lava Monkey
rychan Tue 16:13
Blog : Mac Rant!
rockford Fri 14:48
Dev-Diary : Yup, another song
Kuron Wed 06:39
More

Who's Online
9572AD
Thu, at 19:17
HoboBen
Thu, at 18:56
shroom_monk
Thu, at 16:33
rychan
Thu, at 15:50
Afr0
Thu, at 15:43
dna
Thu, at 15:00
rockford
Thu, at 14:08
Jayenkai
Thu, at 13:15
spinal
Thu, at 13:12
steve_ancell
Thu, at 10:49
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.