-
Align a button in Javascript
Hello,
I am very new to Javascript and other web related stuff.
I am trying to align a button in a javascript file,
The button is defined in an erb file like this
<div id="button1" class="arial buttonprop ten right">CLICK ME ></div>
In another javascript file user hides and shows this button
$('#button1').hide();
$('#button1').show();
Is it possible to allign the button to left right or center in this Javascript file.
Thanks,
Georgy
-
That looks like jQuery. You can use
$('#button1').css()
to set the location or change the alignment of the button.
-
Thanks...
I used the .css() function, i could able to do these things like
1) float : left/right ---- for left/right alignment
2) margin-left : value
margin-right : value
This also is good for left/right alignment
But for aligning to the center i tried
margin-left : auto
margin-right : auto
it doesn't seems to be working.
So Is there any other way to align the button to the center
Thanks
Georgy
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks