I want to create for my little homepage a navigation, which is wider than the viewport. Therefor it should be possible, to drag the whole <ul> - element to the left and to the right.
The navigation has got a fixed height, so the list has just to be dragged across the x axis.
I managed to make the list being draggable... well thats not hard with JQuery UI. But without using the containment atribute, you can shift the whole navigation out of the viewport.
For this reason I used the containment atribute, but this is my problem. If the draggable element is bigger than than the containment, it is just snapping to the left and right margins.
Do I use JQuery wrong for this application, or is there a possability to solve this problem?
Thats my navigation... The LI elements have a width of 240px + 20px margin. So the complete width is 2080px. I want to make the whole UL element draggable inside the DIV container, which has got a width of 95% of the viewport. The navigation should be draggable only on the X-axis.
This is working so far, but when I use the containment attribute, the UL is just snapping to the side borders.
I found a solution, where the containment is given in coordinates [x,y,x,y] but, then the 5% of the viewport are included...
Is there any easier solution to solve this problem?