Latest Uploads
Bumble Bee

dna

Tires

dna

Guess The Remake

rychan

Julia Set Visualer

Andy_A

Julia Set Visualizer

Andy_A

image-07-0 ... -34-29.jpg

Jayenkai

Forum Home

Changing style with javascript = fail :(

UserMessage
Posted : Saturday, 20 August 2011, 06: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, 09:14 | Permalink | Mark Here
CodersRule


And class, this is why we use jQuery.
Homepage : http://tacosareawesome.com/
Posted : Thursday, 25 August 2011, 16: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, 16: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
Jay's New Lumia 1020
Jayenkai Tue 07:45
SAT:AM Loving
Jayenkai Tue 04:10
AGameAWeek Progress Report
rychan Mon 23:57
[OUYA] AquaVenture
Jayenkai Mon 07:57
Happy Birthday to All
Jayenkai Mon 02:15
Mog's Village
Mog Sun 19:20
Good TV?
Jayenkai Sun 02:20
Faceless Piles of Shite
Dabz Thu 18:34
Dabz Takes Manhattan
Jayenkai Thu 18:32
Unity
dna Thu 12:05
More

Latest Items
Techy : Back from Game Dev Con!
Jayenkai Sun 15:52
Family : Sunday
Jayenkai Wed 02:31
Family : Good News (for once)
Kuron Tue 14:37
Showcase : Don't Tap The Zombies
therevillsgames Mon 15:26
Showcase : Mutant Monty
steve_ancell Wed 18:26
Blog : Update
Kuron Mon 12:52
Techy : New Laptop!?
Kuron Fri 14:52
Showcase : Ascension 2 Live Wallpaper
CodersRule Fri 12:48
Showcase : Saviors of Gundthor
CodersRule Fri 11:50
Showcase : Lava Monkey
rychan Tue 15:13
Blog : Mac Rant!
rockford Fri 13:48
Dev-Diary : Yup, another song
Kuron Wed 05:39
Pets : Old pic to share...
rockford Sat 16:01
Blog : EmuMenu
spinal Sat 10:07
Family : More bad news :c(
Kuron Mon 06:07
More

Who's Online
Jayenkai
Tue, at 07:45
rychan
Tue, at 05:12
steve_ancell
Tue, at 04:30
HoboBen
Tue, at 04:01
rockford
Tue, at 02:53
therevillsgames
Tue, at 01:56
spinal
Tue, at 01:26
Krakatomato
Tue, at 01:15
dna
Mon, at 18:30
Mog
Mon, at 12:28
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.