Is it possible to slide a float type div inside another div like this example, but with a white box containing "apple" text sliding inside the black div it's in? I have attempted to recreate the effect using this example. Here is my current JavaScript code:
$(document).ready(function () {
$('#container').mousemove(function (e) {
var x = e.pageX - this.offsetLeft;
$("#recent").text(x + " , " + e.pageX + " , " + $("mainslide").left);
if (e.pageX <= $(window).width() / 2)
$('#slider').css({'left': $(window).width() - e.pageX });
else
$('#slider').css({'right': $(window).width() - e.pageX });
});
});