更改bootstrap-table单元格中复选框的大小

时间:2015-09-08 20:53:31

标签: jquery css twitter-bootstrap twitter-bootstrap-3 bootstrap-table

我使用bootstrap-tablecolumn with checkboxes。如何更改复选框的大小。在我的code我希望复选框尺寸为25x25,但是当我使用高度和宽度的css属性时,它不起作用。

HTML

var data = [{name: 'ala', stargazers_count: 234, forks_count: 234, description: "asdasdas"},
           {name: 'ala', stargazers_count: 234, forks_count: 234, description: "asdasdas"},
           {name: 'ala', stargazers_count: 234, forks_count: 234, description: "asdasdas"}]

$('table').bootstrapTable({
    data: data
});

function starsFormatter(row, value, inde) {
    return row + '<i class="glyphicon glyphicon-star"></i> ';
}

function forksFormatter(value) {
    return '<i class="glyphicon glyphicon-cutlery"></i> ' + value;
}

的javascript

.bs-checkbox input{
    height: 25px;
    width: 25px;
}

CSS

function processCurlJsonrequest($URL, $fieldString)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));
    curl_setopt($ch, CURLOPT_URL, $URL);
    // curl_setopt($ch, CURLOPT_USERAGENT, $this->_agent);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    // curl_setopt($ch, CURLOPT_COOKIEFILE, $this->_cookie_file_path);
    //curl_setopt($ch, CURLOPT_COOKIEJAR, $this->_cookie_file_path);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fieldString));
    curl_setopt($ch, CURLOPT_POST, 1);
    $resulta = curl_exec($ch);
    if (curl_errno($ch)) {
        print curl_error($ch);
    } else {
        curl_close($ch);
    }
    return $resulta;
}
$data_string = array("title" => "jdsdfds","url"=>"sdfdfd","date"=>"2014-01-30");
processCurlJsonrequest('http://localhost/articles',$data_string);

2 个答案:

答案 0 :(得分:1)

简单易行的方法

//inside your controller
$(window).scroll(function() {
  if ($(document).scrollTop() > 50) {
    $('nav').addClass('shrink');
  } else {
    $('nav').removeClass('shrink');
  }
});

//your css
.shrink {
     height: 35px;// set height you which you want while scrolling down
}
  

x,y可以是任何值取决于你想要多大的盒子

答案 1 :(得分:-1)

.bs-checkbox input
{
    zoom:2;
}