Hi there,

I'm currently investigating how to fix this - it's a odd browser bug, Safari
reports
a incredible margin, usually marginRight, which breaks the offset.

On Sun, Nov 23, 2008 at 12:46 PM, dirk w <[EMAIL PROTECTED]>wrote:

>
> this is a really odd problem, does anyone know how i can fix this?
> i want the child only to be draggable within the parent div, but as
> soon as i specify
> containment: 'parent',
> it will break on some browser (FF not included but e.g. safari).
>
> please could you have a look and let me know if there is a way to fix
> this?
>
> dirk
>
> On 19 Nov., 16:44, dirk w <[EMAIL PROTECTED]> wrote:
> > hello community,
> > i am using a parent and child div. the child div is supposed to be
> > dragged from left to right within the parent div. everything works
> > fine, but as soon as i specify: "containment: parent" it just doesn't
> > work anymore in e.g. safari. it still works in firefox.
> >
> > below my code, this issue really only takes place if i specify
> > containment, if i delete the line in my JS code, than it works on all
> > brothers (ff and safari).
> >
> > your help is much appreciated!
> > thanks in advance
> >
> > ---------------- JS ----------------
> > $(document).ready(function(){
> >    $("#child").draggable(
> >       {
> >          axis: 'x',                             // only move horizontally
> >          containment: 'parent',   // DELETE THIS LINE AND IT WORKS....
> >          drag: function(ev, ui)                 // while object is
> dragged, do this:
> >       {
> >          var left = ui.position.left;
> >          console.log("child position: " + left);
> >       }
> >    });
> >
> > });
> >
> > ---------------- CSS ----------------
> > #parent   { width: 960px; height: 50px; background: pink; }
> > #child   { width: 70px; height: 40px; margin: 0 auto; background:
> > green url(../img/regler.png) no-repeat; }
> >
> > ---------------- HTML ----------------
> > <div id="crossfader">
> >    <div id="regler"></div>
> > </div>
> >
>


-- 
Paul Bakaus
UI Architect
--
http://paulbakaus.com
http://www.linkedin.com/in/paulbakaus

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to