Latest Uploads
image-03-0 ... -24-07.jpg

Jayenkai

terraintest.png

GfK

RobotMindsv18

gameleaper

Chariot racing

gameleaper

LandOfTheFlies

gameleaper

Dungeon Ga ... n Progress

rychan

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
Bye Bye OUYA
Jayenkai Mon 14:00
Windows 10
Jayenkai Mon 13:38
Win10 keylogger
steve_ancell Mon 12:23
Happy Birthday, All!
steve_ancell Mon 03:35
RIP : Cilla Black
rockford Sun 08:12
Pot Noodle
steve_ancell Sat 18:27
Classic Screensaver-esque 3D Maze
Dabz Sat 14:34
Don't Be So Fucking Lazy
GfK Sat 05:24
Great Big Youtube thread
Jayenkai Fri 11:33
SpikeDislike Themes?
rychan Fri 07:31
More

Latest Items
Showcase : Daily Dungeon
rychan Sun 05:33
Showcase : isometric prototype
Dabz Fri 12:43
Dev-Diary : Helichopper stuffs
Jayenkai Sat 18:10
Blog : Back on the run
rychan Fri 05:59
Showcase : HexWarrior
gameleaper Thu 07:48
Showcase : SpikeDislike3
rychan Sun 13:51
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 : RobotMinds
gameleaper Thu 14:50
Blog : 3DRetroPrivateer41
gameleaper Wed 20:10
Showcase : WarTactical
gameleaper Wed 19:32
Showcase : TheLandOfTheFlies48Bee
gameleaper Wed 19:17
More

Who's Online
Dabz
Mon, at 14:08
Jayenkai
Mon, at 14:06
rychan
Mon, at 14:05
spinal
Mon, at 13:37
GfK
Mon, at 13:17
steve_ancell
Mon, at 12:39
rockford
Mon, at 11:24
Pakz
Mon, at 10:50
shroom_monk
Mon, at 09:51
9572AD
Mon, at 05:36
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.