Click here to Skip to main content
15,891,763 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi i am working on the Touch Enabled Skinnable Toggle Switches with Jquery Plugin but i do not understand how to assign the margin-left into the div...

This is my html code,
HTML
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>        
        <title>jQuery asSwitch Plugin Demos</title>
        <link rel="stylesheet" href="css/asSwitch.css">
        
        <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>     
        

        <script src="js/jquery-asSwitch.js"></script>        

    </head>
<body>
<div id="wrapper" style="margin-left:100px;">
    
        <h2>jQuery asSwitch Plugin Demos</h2>        

        <section>          
            
            <div class="example">
                <input class="sw-8" type="checkbox" checked="checked" />
                <script>                   
                    $(document).ready(function() {
                        $('.sw-8').asSwitch({
                            skin: 'skin-8'
                        });  
                    });
                </script>
            </div>         
           
        </section> 
</div>
</body>
</html>

and when i see ,
HTML
<div class="asSwitch-inner-box" style="margin-left: -42px;">
<div class="asSwitch-on">LIVE</div>
<div class="asSwitch-off">HIDDEN</div>
</div>
</div>

and i use asSwitch.css, jquery-asSwitch.js and jquery, then i don't understand how assign -42px margin-left to the <div class="asSwitch-inner-box"> please give me a way to find solution for my problem.

[Edit member="Tadit"]
Added pre tags.
[/Edit]
Posted
v3
Comments
You have already assigned the margin-left. Is not that working?
AnUpAm 786 8-Jan-15 0:26am    
margin-left works very well but i do not understand how i can change this margin-left's value... suppose i want margin-left:-65px; is it possible without changing in asSwitch.js file?
See my answer.

1 solution

Just write this class again in your HTML file like..
HTML
<style>
    .asSwitch-inner-box
    {
        margin-left: -65px;
    }
</style>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900