Latest Uploads
Merry Christmas

Jayenkai

Invasion V ... tup screen

rychan

image-07-1 ... -20-59.jpg

Jayenkai

PixeLink - ... oween 2014

rockford

PixeLink P ... zle Editor

rockford

PixeLink

rockford

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
NerdBlock
rockford Sat 06:42
Advent Calendars 2014
rockford Sat 06:36
Festive Pics
Jayenkai Fri 09:34
Penguin Party
rychan Fri 04:17
Christmas Poo
Jayenkai Thu 18:43
iOS dev on Windows.
steve_ancell Thu 14:33
Foodless
rychan Thu 13:52
Cold Neck = Sore Neck
rockford Thu 11:30
OUYA Download Stats
rychan Thu 09:40
Drip Drip Drip
zzoom Wed 15:37
More

Latest Items
News : Newsletter #245
rychan Fri 06:36
Showcase : GPS Fun Runner 3D
zzoom Wed 15:35
Showcase : Santa's Workout 2
Jayenkai Wed 08:10
Showcase : The Biggest Snowman
rychan Mon 01:06
News : Newsletter #243
Dabz Thu 03:29
Dev-Diary : Scaling Back
rychan Wed 14:33
Showcase : Alpha Collexion
rychan Wed 06:23
Life : Health Update
rockford Thu 12:41
Blog : Powerball Hack
steve_ancell Tue 18:47
Hols : Advent Calendars
rychan Wed 04:56
Life : MIA until better
Jayenkai Mon 07:03
News : Newsletter #241
steve_ancell Thu 20:46
Snippet : Monkey Framework - HTML Layout
steve_ancell Thu 08:35
Woot : : Update on hand issues
rychan Fri 10:00
:
Wed 17:00
More

Who's Online
spinal
Sat, at 09:15
steve_ancell
Sat, at 08:32
Jayenkai
Sat, at 08:21
rockford
Sat, at 08:19
shroom_monk
Sat, at 04:01
blanko1324
Fri, at 23:44
9572AD
Fri, at 20:09
rychan
Fri, at 16:46
zzoom
Fri, at 15:55
HoboBen
Fri, at 08:09
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.