Guest User

Untitled

a guest
Jan 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. var cometa = (function(){
  2. this.toggle = function(obj,panel) {
  3. var panel = $(panel);
  4. if(parseInt(panel.css('left')) > 0) {
  5. panel.css('left','');
  6. panel.css('width', $(obj).outerWidth()-1 );
  7. } else {
  8. panel.css('left', parseInt(panel.css('right')) );
  9. panel.css('width', '');
  10. }
  11. };
  12.  
  13. return this;
  14. })(cometa);
  15.  
  16.  
  17.  
  18. $(document).ready(function() {
  19. var panel = $('#cometa_panel');
  20. var right = parseInt(panel.css('right'));
  21. panel.css('left', right);
  22.  
  23. $('#cometa_toggle').click(function(){
  24. cometa.toggle(this,'#cometa_panel');
  25. });
  26. });
Add Comment
Please, Sign In to add comment