Php 在css中拖放时更改光标样式

Php 在css中拖放时更改光标样式,php,css,wordpress,sorting,Php,Css,Wordpress,Sorting,我对图像进行了拖放排序,代码运行得很好,但现在客户端希望当用户拖动行时,光标样式是“指针” 现在默认的光标样式是“移动”。我在css中的每个地方都做了更改,但是没有任何更改 任何人都可以帮助css 任何建议 这是我的密码 <table class="widefat fixed" cellspacing="0" id="image_sort" style="width:100%; table-layout:inherit;"> <thead>

我对图像进行了拖放排序,代码运行得很好,但现在客户端希望当用户拖动行时,光标样式是“指针”

现在默认的光标样式是“移动”。我在css中的每个地方都做了更改,但是没有任何更改

任何人都可以帮助css

任何建议

这是我的密码

<table class="widefat fixed" cellspacing="0" id="image_sort" style="width:100%; table-layout:inherit;">
        <thead>
            <tr>
                <th scope="col" class="column-slug"><?php _e('Image','lgs') ?></th>
                <th scope="col"><?php _e('Image Links To','lgs') ?></th>
                <th scope="col" class="column-slug"><?php _e('Actions','lgs') ?></th>
            </tr>
        </thead>

        <tfoot>
            <tr>
                <th scope="col" class="column-slug"><?php _e('Image','lgs') ?></th>
                <th scope="col"><?php _e('Image Links To','lgs') ?></th>
                <th scope="col" class="column-slug"><?php _e('Actions','lgs') ?></th>
            </tr>
        </tfoot>

        <tbody>

        <form method="post" action="options.php">
        <?php settings_fields('wp_logo_slider_images'); ?>
        <?php foreach((array)$wp_logo_slider_images as $image => $data) : ?>
            <tr id="list_item_<?php echo $image ?>" class="list_item">
                <input type="hidden" name="wp_logo_slider_images[<?php echo $image; ?>][id]" value="<?php echo $data['id']; ?>" />
                <input type="hidden" name="wp_logo_slider_images[<?php echo $image; ?>][file]" value="<?php echo $data['file']; ?>" />
                <input type="hidden" name="wp_logo_slider_images[<?php echo $image; ?>][file_url]" value="<?php echo $data['file_url']; ?>" />
                <input type="hidden" name="wp_logo_slider_images[<?php echo $image; ?>][thumbnail]" value="<?php //echo $data['thumbnail']; ?>" />
                <input type="hidden" name="wp_logo_slider_images[<?php echo $image; ?>][thumbnail_url]" value="<?php echo $data['thumbnail_url']; ?>" />
                <th scope="row" class="column-slug"><img src="<?php echo $data['thumbnail_url']; ?>" /></th>
                <td><?php //echo $image; ?><input type="text" name="wp_logo_slider_images[<?php echo $image; ?>][image_links_to]" value="<?php echo $data['image_links_to']; ?>" size="30" /></td>
                <td class="column-slug"><input type="submit" class="button-primary" value="Update" /> <a href="?page=wp_logo_slider&amp;delete=<?php echo $image; ?>" class="button">Delete</a></td>
            </tr>
        <?php endforeach; ?>
        <input type="hidden" name="wp_logo_slider_images[update]" value="Updated" />
        </form>

        </tbody>
    </table>

<?php

function image_sort(){  
wp_enqueue_script('jquery');
?>
<!--<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>-->
<?php 
wp_enqueue_script('jquery-ui-sortable');
?>
<script type="text/javascript">

jQuery(document).ready( function(e) {
   jQuery('#image_sort').sortable({
            items: '.list_item',
            opacity: 0.5,
            cursor: 'move',
            axis: 'y',
            update: function() {
                var ordr = jQuery(this).sortable('serialize') + '&action=list_update_order';
                jQuery.post(ajaxurl, ordr, function(response){
                    //alert(response);
                });
            }
      });
});

</script>
<?php
    }
    add_action('admin_head','image_sort');

    function order_list(){
        global $wp_logo_slider_images;

        $list = $wp_logo_slider_images;
        $new_order = $_POST['list_item'];
        $new_list = array();

        foreach($new_order as $v){
            if(isset($list[$v])){
                $new_list[$v] = $list[$v];
            }
        }
        update_option('wp_logo_slider_images',$new_list);
    }
    add_action('wp_ajax_list_update_order','order_list');
?>

“size=“30”/>
jQuery(文档).ready(函数(e){
jQuery('#image_sort')。可排序({
项目:'.list_项目',
不透明度:0.5,
光标:“移动”,
轴:‘y’,
更新:函数(){
var ordr=jQuery(this).sortable('serialize')+'&action=list\u update\u order';
post(ajaxurl、ordr、函数(响应){
//警报(响应);
});
}
});
});

为什么不能使用jQuery。更改光标样式

使用jQuery 检查这个 使用CSS 检查这个 HTML


为什么不能使用jQuery.0来更改光标样式

使用jQuery 检查这个 使用CSS 检查这个 HTML

这可以使用伪类来完成

div{
    width: 300px;
    height: 300px;
    background-color: cornflowerblue;
}

div:active{
    cursor: pointer !important;
}

这可以使用伪类来完成

div{
    width: 300px;
    height: 300px;
    background-color: cornflowerblue;
}

div:active{
    cursor: pointer !important;
}

提供您尝试过的css编码,无需代码即可获得帮助。提供您尝试过的css编码,无需代码即可获得帮助。我已经给出了css解决方案。这并不意味着我拥有该解决方案的权威,只是想知道再次发布该解决方案的意义何在?兄弟,我想您没有理解我的意思,我看到了您的JSFIDLE链接和不是我吗want@Mr_Green抱歉,Nadeem说我不再需要jQUery了,所以我展示了另一种使用CSS的方式。ok@JayPatel我在jQUery中做错了,不是在CSS中,现在它工作正常了-非常感谢你的提示我已经给出了CSS解决方案。这并不意味着我拥有它的权威,只是想知道再次发布它的意义是什么?兄弟,我没有你可能不明白我的意思,我看到了你的JSFIDLE链接,这不是我want@Mr_Green抱歉,Nadeem说我不再需要jQUery了,所以我展示了另一种使用CSS的方法。ok@JayPatel我在jQUery中做错了,而不是在CSS中,现在它工作正常了-非常感谢您的支持timing@Nadeem使用
!重要
,因为您正在应用
光标:移动以前使用过jquery。我更新了我的帖子。好的,非常感谢@Mr_Green,现在我把它放到了我出错的地方,因为我复制了过去的代码,所以我没有得到它。在jquery中-cursor:'pointer',现在它的工作很好。:@Nadeem use
!important
,因为你以前使用过jquery应用了
cursor:move
。我更新了我的帖子。好的,非常感谢@Mr_Green,现在我在出错的地方得到了它,因为我复制并通过了代码,所以我没有得到它。在JQUERY中-cursor:“pointer”,。现在它的工作正常了。:)
div{
    width: 200px;
    height:100px;
    border:1px solid #000;
}

div:hover, div:active{
   cursor: pointer;
}
div{
    width: 300px;
    height: 300px;
    background-color: cornflowerblue;
}

div:active{
    cursor: pointer !important;
}