<div class="hover-div" ng-right-click>
<img id="myImage" class="imageSet" src="{{list.img}}" ng-click="currentImage($index)">
</div>
如何實現圖像的圖像限制不能通過瀏覽器URL在AngularJS中拖動?
//here we crate the module for the CRUD application \t \t
\t var app= angular.module("shoppingApp", []);
\t app.directive('ngRightClick', function() {
\t return {
\t restrict: 'A',
\t link: function(scope, element, attr) {
\t element.bind('contextmenu', function(e) {
\t e.preventDefault();
\t })
\t }
\t }
\t })
\t //THIS IS JQUERY CODE FOR IMAGE IS
\t $("#myImage").mousemove(function(e) {
\t \t return false;
\t });
\t $("#myImage").attr("draggable", false); \t
我創造AngularJS技術的電子商務網站中,我也要用圖像限制功能類似 - 用戶無法將圖像通過拖放複製在瀏覽器。那麼,如何在我們的AngularJS網站中實現這個功能呢? ?
你能剛發佈您的角碼嗎? –