Latest Uploads
terraintest.png

GfK

RobotMindsv18

gameleaper

Chariot racing

gameleaper

LandOfTheFlies

gameleaper

Dungeon Ga ... n Progress

rychan

image-17-0 ... -18-36.jpg

Jayenkai

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
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Latest Posts
Dosbox
gameleaper Mon 16:46
Great Big Youtube thread
Jayenkai Mon 16:33
Free my Balls!
Jayenkai Mon 05:16
Jay's New Lumia 1020
Jayenkai Mon 05:04
Finishing off things, who'd have thought!
rychan Mon 03:10
Server Fuckup
rychan Sun 17:05
Understanding..
Dabz Sun 12:54
Apple Music
Jayenkai Sat 17:30
Lego Lights
rockford Fri 06:28
PlayStation Unearthed...?!
Jayenkai Fri 03:18
More

Latest Items
Blog : Back on the run
rychan Mon 14:44
Showcase : SpikeDislike3
rychan Sun 13:51
Showcase : Daily Dungeon
rychan Sun 10:26
Rant : Refresh Creations -> Refresh Games
rychan Sun 08:20
Link : Ban gay marriage?!
steve_ancell Sat 18:01
Article : Advanced BBCode
Jayenkai Sat 06:02
Showcase : Snake Me Do
rychan Thu 15:04
Showcase : 3DRetroPrivateer41
gameleaper Sat 09:02
Showcase : HexWarrior
rockford Fri 11:43
Showcase : RobotMinds
gameleaper Thu 14:50
Showcase : isometric prototype
realtime Thu 01:57
Blog : 3DRetroPrivateer41
gameleaper Wed 20:10
Showcase : WarTactical
gameleaper Wed 19:32
Showcase : TheLandOfTheFlies48Bee
gameleaper Wed 19:17
Dev-Diary : Helichopper stuffs
GfK Sun 06:07
More

Who's Online
gameleaper
Mon, at 17:49
Jayenkai
Mon, at 17:09
rychan
Mon, at 16:37
steve_ancell
Mon, at 15:37
Steve Elliott
Mon, at 14:45
Dabz
Mon, at 13:38
GfK
Mon, at 13:33
spinal
Mon, at 13:15
rockford
Mon, at 12:18
Krakatomato
Mon, at 09:39
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.