Sublime Text浏览器预览,JQuery没有运行

时间:2016-10-25 11:13:15

标签: jquery sublimetext

我尝试使用skrollr设置页面以使用视差。例如,在CodePen上一切正常,但是当我在Sublime Text上设置我的页面并进行预览时,一切都无效。

在进行预览时是否有阻止JQuery运行的内容?我遗失的头标中有什么问题吗?

我尝试了不同的URL并在本地使用JQuery,但没有什么可行的。

<head>
  <title>Parallax</title>
  <link rel="stylesheet" type="text/css" href="birds.css" />
  <script type="text/javascript" src="birds.js"></script>
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/skrollr/0.6.30/skrollr.min.js"></script>
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</head>

3 个答案:

答案 0 :(得分:2)

<Window x:Class="WpfApplication15.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:tz="http://schemas.abtsoftware.co.uk/transitionz"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="b2vc"></BooleanToVisibilityConverter>
    </Window.Resources>
    <Grid>
        <CheckBox x:Name="CheckBox" Content="Is Visible?" IsChecked="False"></CheckBox>
        <TextBlock Text="Hello World!" FontSize="44" HorizontalAlignment="Center" VerticalAlignment="Center"
            Visibility="Collapsed"
            tz:Transitionz.Opacity="{tz:OpacityParams From=0, To=1, Duration=200, TransitionOn=Visibility}"
            tz:Transitionz.Translate="{tz:TranslateParams From='10,0', To='0,0', Duration=200, TransitionOn=Visibility}"
            tz:Transitionz.Visibility="{Binding ElementName=CheckBox, Path=IsChecked, Converter={StaticResource b2vc}}"/>
    </Grid>
</Window>

你能尝试一下这个吗?

答案 1 :(得分:2)

可能是因为您在CDN库之前声明了JS库?

将其作为:

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/skrollr/0.6.30/skrollr.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="birds.js"></script>

答案 2 :(得分:1)

在skrollr之前调用Jquery并尝试:

<head>
  <title>Parallax</title>
  <link rel="stylesheet" type="text/css" href="birds.css" />
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/skrollr/0.6.30/skrollr.min.js">
</script>
  <script type="text/javascript" src="birds.js"></script>

</head>