jquery 无属性的滑动框img base64

46qrfjad  于 2023-03-01  发布在  jQuery
关注(0)|答案(1)|浏览(170)

我怎么才能做一个swipebox。没有[a]属性。只有在img。它不为我工作的一些原因。如果你建议任何其他图书馆打开照片,在我的情况下工作将不胜感激。谢谢

;( function( $ ) {

    $( '.swipebox' ).swipebox();

} )( jQuery );
<script src=" https://cdn.jsdelivr.net/npm/swipebox@1.4.6/lib/ios-orientationchange-fix.min.js "></script>
<link href=" https://cdn.jsdelivr.net/npm/swipebox@1.4.6/src/css/swipebox.min.css " rel="stylesheet">
<script src=" https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.min.js "></script>

<div>
  <div>
    <img class="swipebox" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQgAAAAyCAYAAACgYEWAAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAZDSURBVHhe7ZzPixxFFMf9F7wFT8FkdlFzUFmi+COSRKPi6kFEccWICCqsmCBqIiqohED8cTC6F5E1EvAkeFGIJxU8azz7B8SDnjx6aPfT+Mbayque6p7q3k7m2/Bhe/q9qpmdrfr2e6+q95prdy1XQgjhIYEQQiSRQAghkkgghBBJJBBCiCQSCCFEEgmEECKJBEIIkUQCIYRIIoEQQiSRQAghkkgghBBJJBBCiCQSCCFEEgmEECKJBEKILXbt21fdsLa/2v/mPdWBs/dWhzaP1HDONWz4eG2vZiQQYqFh0t9y7K7q8Ln7s8B3kYRCAjEHT60uVafXl6ofNybVn9/tqeGca2tbNq/NIvPGOx/VeLadYPLwSh0leELQBG1o6/V5tSGB6MCB25aqX87trf75oRl88PX66JtHHnvOvb6TfH7+mxrPNjSkDN7kbwN9eH2XYM+Nt1fHT56qPvnsq+n3FoLQrtz5oNu2JBKIlpx+aTIVgF+/2Fu/Xj20VO2+frmGc65hM78Tz07cvvrgplsPVu+e2ahePPa2ax8CBq83qJsYMrLg7u9N+C70EUkgDilhiOlbJCQQLQj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E14ojIvV8JWa/v9ve/N0FbrEWJ1BPh0KypoWtXAho/5D/GwVpunAENo0zQY20JkQJ+WSnjMSomgrygiXs2YB/oqGT0AosrvT3qGEMT2+mGt/1K3MMXoAwlES5joNumpK/DPYR46+P/j3pxzzWoOQ4mDweBpE0ng6w3CeSDEbQpzLXoIaw8xfdYixv64t21Fz6HvupIEogOkClaTaAKfvtOKFNQkmu7S2PDx2vZNzuQ3EelrRSMuWHahZGEyBpEgOkhFhNiGKDpLIOaA+gJpBwVKNkAB51zra7WiLQwihCBk6NWMGKKWnJpHrl9XuPt3STdo00fkMEYkEGKhoX7QpnCJb+maw5iRQAixBZOelIENT+yKJEoAzrmGbZGEwZBACCGSSCCEEEkkEEKIJBIIIUQSCYQQIokEQgiRRAIhhEgigRBCJJFACCGSSCCEEEkkEEKIBMvVv0dKp+y617maAAAAAElFTkSuQmCC" alt="image">
  </div>
</div>
yfjy0ee7

yfjy0ee71#

jquery应该在swipebox.js之前:
你正在使用的ios-orientationchange-fix.min.js只是对ios的一个修复,不包括swipebox本身。

( function( $ ) {

    $( '.swipebox' ).swipebox();

} )( jQuery );
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.swipebox/1.4.4/js/jquery.swipebox.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/swipebox@1.4.6/src/css/swipebox.min.css" rel="stylesheet">

<div>
  <div>
    <img class="swipebox" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQgAAAAyCAYAAACgYEWAAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAZDSURBVHhe7ZzPixxFFMf9F7wFT8FkdlFzUFmi+COSRKPi6kFEccWICCqsmCBqIiqohED8cTC6F5E1EvAkeFGIJxU8azz7B8SDnjx6aPfT+Mbayque6p7q3k7m2/Bhe/q9qpmdrfr2e6+q95prdy1XQgjh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