Sha256: a86e43fe83c054444ecb4f604d12f35c2c48e61ee12a31b625541ceba6308dd4

Contents?: true

Size: 695 Bytes

Versions: 41

Compression:

Stored size: 695 Bytes

Contents

/**
 * Copyright (c) 2009  Gary Haran => gary@talkerapp.com
 * Released under MIT license [...]
 */
(function($){
  $.fn.clonePosition = function(element, options){
    var options = $.extend({
      cloneWidth: true,
      cloneHeight: true,
      offsetLeft: 0,
      offsetTop: 0
    }, (options || {}));
    
    var offsets = $(element).offset();
    
    $(this).css({
      position: 'absolute',
      top:  (offsets.top  + options.offsetTop)  + 'px',
      left: (offsets.left + options.offsetLeft) + 'px'
    });
    
    if (options.cloneWidth)  $(this).width($(element).width());
    if (options.cloneHeight) $(this).height($(element).height());
    
    return this;
  }
})(jQuery);

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
event_calendar_engine-0.2.15 public/javascripts/event_calendar/jquery.clonePosition.js
file_share-0.1.16 public/javascripts/file_share/jquery.clonePosition.js
event_calendar_engine-0.2.14 public/javascripts/event_calendar/jquery.clonePosition.js
file_share-0.1.15 public/javascripts/file_share/jquery.clonePosition.js
file_share-0.1.13 public/javascripts/file_share/jquery.clonePosition.js
file_share-0.1.12 public/javascripts/file_share/jquery.clonePosition.js
file_share-0.1.11 public/javascripts/file_share/jquery.clonePosition.js
event_calendar_engine-0.2.13 public/javascripts/event_calendar/jquery.clonePosition.js
event_calendar_engine-0.2.11 public/javascripts/event_calendar/jquery.clonePosition.js
event_calendar_engine-0.2.10 public/javascripts/event_calendar/jquery.clonePosition.js
event_calendar_engine-0.2.8 public/javascripts/event_calendar/jquery.clonePosition.js
file_share-0.1.9 public/javascripts/file_share/jquery.clonePosition.js
event_calendar_engine-0.2.7 public/javascripts/event_calendar/jquery.clonePosition.js
event_calendar_engine-0.2.6 public/javascripts/event_calendar/jquery.clonePosition.js
event_calendar_engine-0.2.5 public/javascripts/event_calendar/jquery.clonePosition.js
file_share-0.1.8 public/javascripts/file_share/jquery.clonePosition.js
event_calendar_engine-0.2.4 public/javascripts/event_calendar/jquery.clonePosition.js
event_calendar_engine-0.2.3 public/javascripts/event_calendar/jquery.clonePosition.js
event_calendar_engine-0.2.2 public/javascripts/event_calendar/jquery.clonePosition.js
event_calendar_engine-0.2.1 public/javascripts/event_calendar/jquery.clonePosition.js