开发者

jCrop is not being called.

jQuery('#imgCrop').Jcrop() is not being called. Am I referencing jCrop correctly? Please refer 开发者_StackOverflowto my links for my VS2010 screenshots. Thanks!

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<link href="Scripts/jCrop-v0.9.9/css/jquery.Jcrop.css" rel="stylesheet" type="text/css" />
<script src="Scripts/jCrop-v0.9.9/js/jquery.min.js" type="text/javascript"></script>
<script src="Scripts/jCrop-v0.9.9/js/jquery.Jcrop.min.js" type="text/javascript"></script>
<script src="Scripts/jCrop-v0.9.9/js/jquery.Jcrop.js" type="text/javascript"></script>
<script type="text/javascript">

    jQuery(document).ready(function () {

        jQuery('#imgCrop').Jcrop({
            onSelect: storeCoords
        });
    });

    function storeCoords(c) {

        jQuery('#X').val(c.x);
        jQuery('#Y').val(c.y);
        jQuery('#W').val(c.w);
        jQuery('#H').val(c.h);
    };
</script>

http://i.stack.imgur.com/ZSJqw.png

http://i.stack.imgur.com/FVdPP.png


Did you remove the extraneous jcrop include from the header? You only need to include Jcrop once; in your example you're pulling in both the full and minimized versions. Instinct says the 2nd include would just overwrite the first in this case, but it doesn't hurt to check.

Have you tried sending the function inline? Or calling Jcrop() without arguments? (to see if the function is causing issue).

jQuery.Jcrop('#imgCrop', {
    onSelect: function (c) {
        jQuery('#X').val(c.x);
        jQuery('#Y').val(c.y);
        jQuery('#W').val(c.w);
        jQuery('#H').val(c.h);
    }
});

I'm grasping at straws a bit here because otherwise it looks like it should work. I'm not an ASP developer so I can't tell if your issue exists there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜