小编Nan*_*ndu的帖子

如何在input元素的max属性中查找值

如何使用Jquery在input元素的max属性中查找值

<input type="number" id="pageNumber" class="toolbarField pageNumber" value="1" size="4" min="1" tabindex="7" max="29">
Run Code Online (Sandbox Code Playgroud)

我试过了

$("input[max]").val()
Run Code Online (Sandbox Code Playgroud)

但它没有帮助

html jquery

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

datepicker中的maxDate选项

我有一个像这样的Jquery UI datepicker.

在此输入图像描述
我只能从datepicker中选择月份和年份.
码:-

$('#datepicker').datepicker({
     changeMonth: true,
     changeYear: true,
     showButtonPanel: true,
     dateFormat: 'M yy',
     maxDate: '0',                      
     onClose: function() {
          var iMonth = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
          var iYear = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
          $(this).datepicker('setDate', new Date(iYear, iMonth, 1));                              
    },
     beforeShow: function(input, inst) {
          $(inst.dpDiv).addClass('calendar-off');                             
     }
});
Run Code Online (Sandbox Code Playgroud)

如果我设置 maxDate: '0'最大月份和年份,我可以选择当前月份和当前年份.
我想使用jquery设置最大月份和年份.对于包含日期,月份,年份的普通日期选择器,首先我删除此maxDate: '0'代码,然后使用以下代码设置最大日期

var maximumDate = '07-15-2013';
$("#datepicker" ).datepicker( "option", "maxDate", maximumDate);
Run Code Online (Sandbox Code Playgroud)

如何设置月份和年份选择器的最大日期?上面的代码在这种情况下不起作用.请给我你的建议.

jquery jquery-ui datepicker jquery-ui-datepicker

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

jqplot中的条宽度太大

我是jqplot的新手,当我想绘制条形图时,x轴是日期,间隔是1天.这是我的代码的一部分:

     axesDefaults:{                                                                  
          tickRenderer: $.jqplot.CanvasAxisTickRenderer,                              
         tickOptions:{
            fontSize:'10pt',
         },                                                                          
    },                                                                              
     axes:{                                                                          
         xaxis:{
            renderer:$x_renderer,                                                   
             tickOptions:{
               formatString:'%Y-%#m-%#d',                                          
            },
            rendererOptions:{                                                       
                 tickOptions:{
                     angle:-90,                                                      
                 }                                                                   
              },                                                                      
             label:'$label',
             tickInterval:'86400000',
         },
         yaxis:{                                                                     
            tickOptions:{
               formatString:'%.2f',                                                
             },                                                                      
           autoscale:true                                                          
         }, 
    },                                                                              
     highlighter:{ 
         show:true,                                                                  
    },
Run Code Online (Sandbox Code Playgroud)

但我发现每个条的宽度太大而无法相互覆盖.怎么解决?

谢谢!

jqplot

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

在 PHP 中获取两个日期之间的日期名称

如何在 PHP 中获取两个日期之间的天数?

输入:

开始日期:2013 年 1 月 1 日
结束日期:2013 年 1 月 5 日

输出:

周二
周三
周四
周五
周六

尝试过代码

$from_date ='01-01-2013';
$to_date ='05-01-2013';

$number_of_days = count_days(strtotime($from_date),strtotime($to_date));

for($i = 1; $i<=$number_of_days; $i++)
{
    $day = Date('l',mktime(0,0,0,date('m'),date('d')+$i,date('y')));
    echo "<br>".$day;       
}


function count_days( $a, $b )
{       
    $gd_a = getdate( $a );
    $gd_b = getdate( $b );
    
    $a_new = mktime( 12, 0, 0, $gd_a['mon'], $gd_a['mday'], $gd_a['year'] );
    $b_new = mktime( 12, 0, 0, $gd_b['mon'], $gd_b['mday'], $gd_b['year'] );
    
    return round( …
Run Code Online (Sandbox Code Playgroud)

php

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

如何将样式添加到特定列表元素,即在<nav>中单个<li>?

关于我的列表的CSS样式我有一个问题.

这是代码.

CSS

NAV {
width: 940px;
height: 50px;
float: left;
font-family: Geneva,Arial;
border: 1px solid #000000;
background-color: #D0DBF0;}

NAV ul {
    margin: 0px auto;
    padding-top: 15px;
        padding-left: 70px;
    list-style-type: none;
}
NAV li {
    display: inline;

}

NAV li a {
    float: left;
    text-align: center;
    border-right: 2px solid #00DBF0;
    width: 100px;  
    font-size: 14px; 
    padding: 0px 10px;
    color: #0000FF;
    text-decoration: none;
}
Run Code Online (Sandbox Code Playgroud)

HTML

<NAV>
        <UL>
            <LI><a href="#">Home</a></LI>
            <LI><a href="#">About Us</a></LI>
            <LI><a href="#">Contact Us</a></LI>
            <LI><a href="#">Red Widgets</a></LI>
            <LI><a href="#">Blue …
Run Code Online (Sandbox Code Playgroud)

css

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

将jquery代码放在网上时有错误行

计划使用灯箱将可滚动图库放在网上.我遇到了一个错误,我的一个代码有意外的":",预计其中一个:"}","", ATTR

使用CMS简单.对于cmsms错误,它显示

在文件/xxx/xxx/public_html/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php的第702行

这是我计划放在我网站上的代码. http://sorgalla.com/jcarousel/

我会在这里发布我的错误和之后的完整脚本.

错误代码.

jQuery("#gallery-prev").click(function(){
            if(jQuery("#gallery").position().left < 0 && !jQuery("#gallery").is(":animated")){
                jQuery("#gallery").animate({left : "+=" + imageWidth + "px"});
            }
            return false;
        });
Run Code Online (Sandbox Code Playgroud)

完整代码.

<script type="text/javascript">
$(window).load(function(){ 

    // Gallery
    if(jQuery("#gallery").length){

        // Fancybox
        jQuery("#gallery li a").fancybox({
            'titleShow'     : false,
            'transitionIn'  : 'elastic',
            'transitionOut' : 'elastic'
        });

        // Variables aren't use properly due to Webkit
        var totalImages = jQuery("#gallery > li").length, 
            imageWidth = jQuery("#gallery > li:first").outerWidth(true),
            totalWidth = imageWidth * totalImages,
            visibleImages = Math.round(jQuery("#gallery-wrap").width() / imageWidth),
            visibleWidth …
Run Code Online (Sandbox Code Playgroud)

php jquery

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

R-从数据框中查找缺失值并在该位置插入值

使用R脚本我从数据库中读取值.值包含以下数据框.

>values #return the output as follows

ID           Date      Hour      Value
1          2013-06-01    8           9
2          2013-06-01    9          17
3          2013-06-01   10          16
4          2013-06-01   11          21
5          2013-06-01   12          19
6          2013-06-01   13          15
7          2013-06-01   14          14
8          2013-06-01   15          14
9          2013-06-01   16          21
10         2013-06-01   17          22
11         2013-06-01   18          13
12         2013-06-01   19           2
13         2013-06-01   20           2
14         2013-06-01   21           1
15         2013-06-01   22           1
16         2013-06-01   23           1
17         2013-06-02    0           0
18 …
Run Code Online (Sandbox Code Playgroud)

r

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

Jqplot y轴缩放

我想像下面的图像一样缩放y轴 在此输入图像描述

但我有如下图 在此输入图像描述

我想像第一个图一样实现y轴缩放.我想在大范围内显示.09和1之间的值.我还想将pf值范围显示为0到1(最小值为0,最大值为1).

任何的想法?

我试过的代码就在这里

$.jqplot.config.enablePlugins = true;
var chartData = [[1, .92], [2,.93], [3, .98],[4,.95]];

function PlotChart(chartData) {

    var plot2 = $.jqplot('chart1', [chartData], {
        title: '',
        seriesDefaults: {
            renderer: $.jqplot.CanvasAxisLabelRenderer,
            rendererOptions: {
                smooth: true
            },
            pointLabels: {
                show: true
            }
        },
        axes: {
            xaxis: {
                label: 'date',
                ticks : [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10','11', '12', '13', '14'],
                renderer: $.jqplot.CategoryAxisRenderer,
                // renderer to use to draw the axis,     
                tickOptions: {
                    formatString: '%d' …
Run Code Online (Sandbox Code Playgroud)

jquery jqplot

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

浏览和上传文件上的图像按钮

我想使用“浏览”和“上传”按钮

我有使用以下代码的文本框:

的CSS

   .uploadpathdiv
    {
     margin:0;
     height:44px;
     width:464px;
     background:url('images/img-upload.png') no-repeat bottom;
    }


.uploadpath
{
 background:none;
 border:none;
 width:400px;
 height:40px;
 margin:0;
 padding: 2px 7px 0px 7px;
 font-family:Verdana, Arial, Helvetica, sans-serif;
 font-size:11px;
}
Run Code Online (Sandbox Code Playgroud)

的HTML

<div class="uploadpathdiv">
<input class="uploadpath" name="path" type="text" />
</div>
<img src="/themes/scaccarium/images/button-upload.png" />
<img src="/themes/scaccarium/images/button-browse.png" />
Run Code Online (Sandbox Code Playgroud)

图像代码既用于“浏览”按钮,又用于“上传”按钮。

请帮助我更正上面的代码,以便当我按下浏览按钮时,如您在使用时所看到的那样,得到“文件选择选项” <input type = "file" name="browse">。其次,文件的路径必须显示在上面的文本框中。

第三,当我按下上传按钮时,文件应该被上传

html

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

使用ARIMA对一个月的每日数据进行时间序列预测

我每个周期工作30天(每月),因此在我的历史数据集中有大约2个周期.

R 脚本是,

library(forecast)
value <- c(117.2 , 224.2 , 258.0 , 292.1 , 400.1 , 509.9 , 626.8 , 722.9 , 826.1 , 883.6,916.6, 1032.1, 1151.2, 1273.4 ,1391.8, 1499.2, 1532.5 ,1565.9 ,1690.9, 1813.6,1961.4 ,2102.8 ,2208.2, 2256.8, 2290.8 ,2413.7, 2569.4 ,2730.3, 2882.9 ,2977.5, 117.2 , 224.2 , 258.0 , 292.1 , 400.1 , 509.9 , 626.8 , 722.9 , 826.1 , 883.6,916.6, 1032.1, 1151.2, 1273.4 ,1391.8, 1499.2, 1532.5 ,1565.9 ,1690.9, 1813.6,1961.4 ,2102.8 ,2208.2, 2256.8, 2290.8 ,2413.7, 2569.4 ,2730.3, 2882.9 ,2977.5) …
Run Code Online (Sandbox Code Playgroud)

r time-series forecasting

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

有时没有点击时会调用.click()

.click在JavaScript函数中添加了一个输入按钮类型的函数.
.Click函数调用另一个JavaScript函数.但由于某种原因,该.click功能一直被调用.即使元素没有点击也是如此.
以下是我的代码.谢谢你的协助.

function loadBook(URL) {
    alert(URL);
};

function LoadAllBooks(URL, attachPoint) {
    var title = "This is some code bad code";
    var classname = title.replace(/\s/g, "");
    var htmlString = '<div class="' + classname + '"><input type="button" value="' + title + '"></div>';
    $(htmlString).appendTo(attachPoint).click(loadBook(URL));
};
Run Code Online (Sandbox Code Playgroud)

attachPoint是HTML中的引用,由以下行获取.

 var attachpoint=document.querySelector('.buttonAttachPoint');
Run Code Online (Sandbox Code Playgroud)

html javascript jquery onclick

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

PHP:将日期从YFd格式转换为Ymd格式

我想将PHP日期从YFd格式转换为Ymd格式.我使用下面的代码.

<?php
$originalDate = "2014-March-03";
$newDate = date("Y-m-d", strtotime($originalDate));
echo $newDate ;
?>
Run Code Online (Sandbox Code Playgroud)

我得到一个输出

2014年3月1日

当我转换日期 "2014年3月3日"

<?php
$originalDate = "2014-Mar-03";
$newDate = date("Y-m-d", strtotime($originalDate));
echo $newDate ;
?>
Run Code Online (Sandbox Code Playgroud)

我得到了像

2014年3月3日

为什么第一个没有给出正确的结果?

php date

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

如何在ActionScript中解密MD5哈希?

如何在ActionScript中解密MD5哈希?

那是flash游戏,我想在flash游戏中学习解密md5.谢谢..

图片:http://b1302.hizliresim.com/16/8/jwu73.jpg

以及如何解决base64和sha1代码?

    package com
{

    public class MD5 extends Object
    {
        public static const HEX_FORMAT_LOWERCASE:uint = 0;
        public static const HEX_FORMAT_UPPERCASE:uint = 1;
        public static const BASE64_PAD_CHARACTER_DEFAULT_COMPLIANCE:String = "";
        public static const BASE64_PAD_CHARACTER_RFC_COMPLIANCE:String = "=";
        public static var hexcase:uint = 0;
        public static var b64pad:String = "";

        public function MD5()
        {
            return;
        }// end function

        public static function encrypt(param1:String) : String
        {
            return hex_md5(param1);
        }// end function

        public static function hex_md5(param1:String) : String
        {
            return rstr2hex(rstr_md5(str2rstr_utf8(param1)));
        }// end …
Run Code Online (Sandbox Code Playgroud)

md5 actionscript-3

-3
推荐指数
1
解决办法
735
查看次数