jquery - PhpStorm jQuery.noConflict() css 完成不起作用

标签 jquery css phpstorm code-completion code-hinting

$('#') // hint a list of id
var j = jQuery.noConflict()
j('#') // no hint
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

在评论中使用上下文

最佳答案

<!-- Putting jQuery into no-conflict mode. -->
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
 
var $j = jQuery.noConflict();
// $j is now an alias to the jQuery function; creating the new alias is optional.
 
$j(document).ready(function() {
    $j( "div" ).hide();
});
 
// The $ variable now has the prototype meaning, which is a shortcut for
// document.getElementById(). mainDiv below is a DOM element, not a jQuery object.
window.onload = function() {
    var mainDiv = $( "main" );
}
 
</script>

关于jquery - PhpStorm jQuery.noConflict() css 完成不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44469388/

相关文章:

javascript - 运行 jquery 函数后 CSS 悬停效果不起作用

javascript - Jquery 不适用于动态添加的按钮?

css - Microsoft Edge 动画问题

javascript - 如何将 CSS/JS/Image 预处理器与 django.contrib.staticfiles 集成?

terminal - PhpStorm 不断打开默认的 macOS 终端

javascript - jquery 分离() : [object Object] has no method 'replace'

css - 图片高度响应 Bootstrap 2

javascript - 在 phpstorm 中正确地语法高亮 javascript

php - 在 PhpStorm 中隐藏选项卡标签中的文件扩展名

javascript - jquery 文件上传成功后如何从 C# MVC Controller 获取响应