G
G
Gleb Starkov2022-01-18 17:07:10
HTML
Gleb Starkov, 2022-01-18 17:07:10

Links not working on the mobile version of the site?

There is this code:

@foreach($images as $image)
    <div class="span3 my-img" data-image-id="{{ $image->id }}">
        <img src="/photo/{{ $object->id }}/{{ $image->id }}.{{ $image->name }}" style="height: 100px;" />
        <p><a href="#" data-object-id="{{ $object->id }}" data-image-id="{{ $image->id }}" onclick="return deleteImage(this)">УДАЛИТЬ</a></p>
    </div>
@endforeach


It is used in the admin part of the site, so I can’t show it on the site.

The "DELETE" link does not work when they enter the site through smartphones, in the imitation of the mobile version in the browser - everything is ok.

The draggable code is still attached to this div, that is, the divs are dragged along with the links.

What could be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2022-01-19
@colonel

Make draggable on a separate handle, and not on the whole div, most likely the touchstart swallows the click.

More or less like this
61e6d8e2cb897176164090.gif

For jquery draggable example here: https://jqueryui.com/draggable/#handle
For sortablejs here: sortablejs.github.io/Sortable/#handle

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question