$( ".product").on("mouseenter", function(){
$(this).append('<span class="sale"></span>');
}).on("mouseleave", function(){
$(".sale").remove();
});
$(document).on("mouseenter", ".product", function(){
$(this).append('<span class="sale"></span>');
}).on("mouseleave", ".product", function(){
$(".sale").remove();
});
.wrapper{
position: fixed;
left: -100px;
right: -100px;
top:-100px;
bottom: -100px;
overflow: hidden;
}
- соотвественно драг по containment: 'parent'drag: function( event, ui ) {
$( "#draggable" ).draggable( "option", "containment", [x1, y1, x2, y2 ]);
start: function( event, ui ) {
x1 = -10;
x2 = $(window).width() - $('#draggable').outerWidth() + 10;
y1 = $(window).scrollTop() - 10;
y2 = $(window).height() - $('#draggable').outerHeight() + $(window).scrollTop() + 10;
$( "#draggable" ).draggable( "option", "containment", [x1, y1, x2, y2]);
}
$(window).scrollTop() - на сколько px прокручена страница
}
https://www.bkosborne.com/jquery-waterwheel-carousel
https://www.bkosborne.com/jquery-feature-carousel