小编Qco*_*com的帖子

错误:未捕获TypeError:对象#<对象>没有方法'pan'

出于某种原因,我收到此错误消息:

Uncaught TypeError: Object #<an Object> has no method 'pan'
Run Code Online (Sandbox Code Playgroud)

对于这行代码:

$('#bg_1').pan({fps: 3, speed: 2, dir: 'right'});
Run Code Online (Sandbox Code Playgroud)

我在这行代码之前连接了spritely插件,如下所示:http: //www.marioplanet.com/index.asp

有任何想法吗?

jquery

2
推荐指数
1
解决办法
2352
查看次数

尝试编译时C#换行常量错误

出于某种原因,当我尝试使用Visual Studio命令提示符将.cs文件编译为.dll时,我会new line constant error因某种原因尝试编译.

之后不喜欢分号+ feet".

知道为什么吗?

这是我的代码:

/* A simple C# class! */

public class Tree
{
    public int height = 0;

    public void Grow(int h)
    {
        height += h;
    }

    public string Message()
    {
        return "The height of tree1 is:<br/>" + tree1.height + feet";
    }    
}
Run Code Online (Sandbox Code Playgroud)

c# compiler-construction compilation

2
推荐指数
1
解决办法
6845
查看次数

jquery css高度设置不正常

我正在尝试使用一些jQuery来设置我的产品和目录页面的左右列(带有一个类.columns)到我的高度,#detail <div>其中有一些数据从SQL数据库中提取.

所以,我正在使用这个jQuery代码:

$(document).ready(function() {

  detailHeight = $('#detail').css('height');
  columnHeight = detailHeight + 10;

  $('.columns').css('height', columnHeight 'px');

});
Run Code Online (Sandbox Code Playgroud)

我的页面在这里:http://www.marioplanet.com/product.asp?IDnum = 1

由于某种原因,高度不正确..

任何想法为什么?

谢谢!

css jquery height

2
推荐指数
1
解决办法
2万
查看次数

document.getElementById('id')是null javascript错误

出于某种原因,我document.getElementById('id') is null在第7行得到了一个带有以下标记和脚本的JS错误:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Quadratic Root Finder</title>
<script>
document.getElementById('calculate').onclick = function calculateQuad()
{
    var inputa = document.getElementById('variablea').value;
    var inputb = document.getElementById('variableb').value;
    var inputc = document.getElementById('variablec').value;

    root = Math.pow(inputb,2) - 4 * inputa * inputc;
    root1 = (-inputb + Math.sqrt(root))/2*inputa
    root2 = (-inputb + Math.sqrt(root))/2*inputa 

    document.getElementById('root1').value = root1;
    document.getElementById('root2').value = root2;
    if(root<'0')
    {
        alert('This equation has no real solution.')
    }
    else {
        if(root=='0')
        {
            document.getElementById('root1').value = root1
            document.getElementById('root2').value = 'No Second Answer' …
Run Code Online (Sandbox Code Playgroud)

javascript null

2
推荐指数
1
解决办法
3万
查看次数

create mysql database on mac os x

I know this sounds a little ridiculous, but I'm just honestly wondering how I can create a MySQL database on my Mac OS X machine. I have MySQL installed (as far as I know) as well as PHP, and I'm wondering how I can create one.

I have downloaded a sample PHP ecommerce site to kind of delve into what I'm trying to familiarze myself with, and the PHP files are attempting to connect to a nonexistant database, which I'm …

php mysql database macos

2
推荐指数
1
解决办法
5714
查看次数

是否值得在Objective-C 2.x之前学习Objective-C 1.x?

我知道一些差异,比如垃圾收集和64位支持,但是我有一本基于1.x的书,我想知道我是否会浪费我的时间来学习,然后,在升级到2.1之后读?

objective-c

1
推荐指数
1
解决办法
1124
查看次数

如何使用jQuery为CSS sprites制作动画

我试图找到使用CSS sprites和jQuery复制12fps动画的最简单方法.

我在想使用setInterval()所以每83.33毫秒,下一个sprite将被加载.

我的问题是,我不知道该怎么做......

我在想,因为我的精灵名称是增量的,如:

mariohammerswing1.png 
mariohammerswing2.png 
mariohammerswing3.png
etc.
Run Code Online (Sandbox Code Playgroud)

所以,如果我们可以以某种方式增加它,直到我们到达最后一个实例,在这种情况下mariohammerswing5.png,它将循环回到开头.

如果我能弄清楚那部分,我准备好了!:)

有什么建议?

javascript jquery timer css-sprites

1
推荐指数
1
解决办法
5588
查看次数

在Node.js中使用WebSockets的最简单方法

我想在Node.js网络应用程序中使用WebSockets,我正在寻找最简单的方法.我见过很多github存储库似乎提供了一些易用性.

但是,我只是想看看是否有一个能够获得最多支持或最广泛实施的产品.

我有点倾向于Socket.IO,但我不完全确定.

有什么建议?

谢谢!

websocket node.js socket.io

1
推荐指数
1
解决办法
794
查看次数

将客户端路由到node.js中的外部站点?

这可能很容易,或者只是不可能 - 但在我看来这值得提出.

原因是因为我试图演示一个快速而肮脏的(lol)url-shortening应用程序.

app.get('/link/:key', function(req, res){
  client.get(req.params.key, function(err, reply){
    if(client.get(reply)){
      // route to reply here
    }
    else{
      res.render('index', {
        link: null
      });
    }
  });
});
Run Code Online (Sandbox Code Playgroud)

如果可能的话,我将如何执行该路线?

url redirect http node.js

1
推荐指数
1
解决办法
2488
查看次数

C#中横向滚动游戏的难度

我只是想知道,如果我开始学习C#,我需要花多长时间才能使用XNA Game Studio(4.0)和框架来制作一个XBOX 360 Live Arcade横向滚动游戏.

实际上,我也有其他优先事项,所以我只是想知道"项目"是否可行.显然,如果我想制作一个全面的现场街机游戏,我需要找一个愿意做一些艺术设计的朋友,也许还有一些愿意帮助编码的人.

有任何想法吗?游戏相对简单,但我想让它独特,视觉上吸引人(更多的是在艺术方面),使它脱颖而出.

c# xna xna-4.0

0
推荐指数
1
解决办法
4375
查看次数

C#数学计算无法正常工作

好的,所以我在这里执行一个烦人的数学计算,试图解决其中一个立方根.

现在,这是我的C#代码:

public void CubeCalculate()
{
    //Calculate discriminant

    double insideSquareRoot = (18 * cubicAValue * cubicBValue * cubicCValue * cubicDValue) + (-4 * (Math.Pow(cubicBValue, 3) * cubicDValue) + (Math.Pow(cubicBValue, 2) * Math.Pow(cubicCValue, 2)) + (-4 * cubicAValue * Math.Pow(cubicCValue, 3)) + (-27 * Math.Pow(cubicAValue, 2) * Math.Pow(cubicDValue, 2)));

    if (insideSquareRoot < 0)
    {
        //One real solution, two imaginary
        double onecuberootradical1 = (1 / 2) * (((2 * Math.Pow(cubicBValue, 3)) + (-9 * cubicAValue * cubicBValue * cubicCValue) + (27 * …
Run Code Online (Sandbox Code Playgroud)

c# math polynomial-math c#-4.0

0
推荐指数
1
解决办法
1469
查看次数

C#模数最大的素数因子?

我想知道是否有可能通过在C#中使用模数来找到数字的最大素数因子.换句话说,如果i % x == 0那时我们可以打破一个for循环或类似的东西,其中x等于低于我们的i值的所有自然数.

我如何指定all natural numbers below our i value等于我们的x变量?如果你知道我在说什么,写出每个整数的条件变得有点乏味.

顺便说一句,我敢肯定有一个更简单的方法在C#中要做到这一点,所以请让我知道,如果你有一个想法,但我也想尝试解决这种方式,只是为了看看如果我能用我的初学者知识做到这一点.

这是我目前的代码,如果你想看到我到目前为止:

static void Main()
{
    int largestPrimeFactor = 0;

    for (long i = 98739853; i <= 98739853; i--)
    {
        if (true)
        {
            largestPrimeFactor += (int) i;
            break;
        }
    }

    Console.WriteLine(largestPrimeFactor);
    Console.ReadLine();
}
Run Code Online (Sandbox Code Playgroud)

c# for-loop if-statement prime-factoring

0
推荐指数
1
解决办法
1025
查看次数

用jQuery正确隐藏`<div>`?

我有以下HTML:

<div class="alert-message success">
  <a class="close" style="display: none; ">×</a>
  <p>Authenticated as Zach.</p>
</div>
Run Code Online (Sandbox Code Playgroud)

以下是jQuery:

$('.close').click(function(){
  $('.alert-message success').hide('slow');
});
Run Code Online (Sandbox Code Playgroud)

隐藏一个有什么根本性的错误<div>吗?如果我隐藏了.close,没有问题.我不知道为什么这不起作用.

jquery click hide

0
推荐指数
1
解决办法
233
查看次数