/    Sign up×
Community /Pin to ProfileBookmark

IE Draggable UI – Going Nuts

Hi, the code below works as a bar with a handle which you drag from left to right which will scroll images. This works in everything except IE and its driving me nuts!!!! Could anyone shed some light to why

Thanks in advance

[CODE]$(document).ready(function()
{
$(‘.button’).attr(‘data-show’, ‘0’);
$(‘.items’).wrapInner(“<table><tr>”);
$(‘.items .item’).wrap(“<td></td>”);

$(‘.button’).click(function()
{
$(this).attr(‘data-show’, $(this).attr(‘data-show’) == ‘0’ ? ‘1’ : ‘0’);

var show = ($(this).attr(‘data-show’) == ‘1’);
var eItem = $(this).parent(‘.image’).parent(‘.item’);

$(this).text(show ? ‘Close’ : ‘More Details’);
eItem.animate({width: show ? ‘400px’ : ‘200px’}, 400);
eItem.children(‘.image’).animate({left: show ? ‘200px’ : ‘0px’},
400, function()
{
eItem.children(‘.info’).css(‘display’, show ? ‘block’ : ‘none’);
});
});

$(‘.handle’).draggable({
containment: ‘.bar’,
drag: function(event, ui)
{
var full = $(‘.bar’).width() – $(this).width();
var position = ui.position.left / full;

position *= ($(‘.items’).children(‘table’).width() – $(‘.itemWrap’).width());
$(‘.itemWrap’).scrollLeft(position);
}
});

document.onselectstart = function() {
return false;
};
});[/CODE]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @m0rt1l spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...