- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试创建一个功能,当您从下拉列表中选择一个区域并请求它的降雨数据时,您将获得该数据的 Google 图表。
但是,它不起作用。
你能检查一下是什么问题吗?
提前为难看的代码道歉。我是JS的新手。我对代码进行了注释,以帮助更好地理解它。
谢谢:)
这是 fiddle .
这是 HTML -
<!-- Some text -->
<div class="text">
Select a region below to know the annual rainfall in that region.
</div>
<!-- Create dropdown list -->
<div>
<select class="region">
<option selected="selected" disabled>Select a region</option>
<option>Andaman & Nicobar Islands</option>
<option>Arunachal Pradesh</option>
<option>Assam, Meghalaya</option>
<option>Bihar</option>
<option>Chattisgarh</option>
<option>Coastal Karnataka</option>
<option>Coastal Andhra Pradesh</option>
<option>East Rajasthan</option>
<option>East Madhya Pradesh</option>
<option>East Uttar Pradesh</option>
<option>Gangetic West Bengal</option>
<option>Gujarat Region, Dadra & Nagar Haveli</option>
<option>Haryana, Delhi, Chandigarh</option>
<option>Himachal Pradesh</option>
<option>Jammu, Kashmir</option>
<option>Jharkhand</option>
<option>Kerala</option>
<option>Kokan, Goa</option>
<option>Lakshadweep</option>
<option>Madhya Maharashtra</option>
<option>Maratwada</option>
<option>Nagaland, Manipur, Mizoram, Tripura</option>
<option>North Interior Karnataka</option>
<option>Orissa</option>
<option>Punjab</option>
<option>Rayalseema</option>
<option>Saurashtra, Kutch, Diu</option>
<option>South Interior Karnataka</option>
<option>Sub-Himalayan, West Bengal, Sikkim</option>
<option>Tamil Nadu, Pondicherry</option>
<option>Telengana</option>
<option>Uttaranchal</option>
<option>Vidarbha</option>
<option>West Madhya Pradesh</option>
<option>West Rajasthan</option>
<option>West Uttar Pradesh</option>
</select>
</div>
<!-- Create button to request data -->
<div>
<button type="button">Get data!</button>
</div>
<!-- Div in which the chart will be drawn -->
<div id="chart">
</div>
这是 JS -
// Get region text
var region = jQuery(".region").find(":selected").text();
//Create button variable
var button = jQuery("button");
//Detect change in region selection and store the selected region in the variable
jQuery(".region").change(function() {
region = jQuery(".region").find(":selected").text();
});
//When the data is requested (button is pressed)
button.click(function() {
google.charts.load('current', {
'packages': ['corechart']
});
google.charts.setOnLoadCallback(drawChart);
//Drawing the chart
function drawChart() {
var query;
//Tests to check which region is selected
if (region == "Andaman & Nicobar Islands") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:B");
} else if (region == "Arunachal Pradesh") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:C");
} else if (region == "Assam, Meghalaya") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:D");
} else if (region == "Bihar") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:E");
} else if (region == "Chattisgarh") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:F");
} else if (region == "Coastal Karnataka") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:G");
} else if (region == "Coastal Andhra Pradesh") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:H");
} else if (region == "East Rajasthan") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:I");
} else if (region == "East Madhya Pradesh") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:J");
} else if (region == "East Uttar Pradesh") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:K");
} else if (region == "Gangetic West Bengal") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:L");
} else if (region == "Gujarat Region, Dadra & Nagar Haveli") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:M");
} else if (region == "Haryana, Delhi, Chandigarh") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:N");
} else if (region == "Himachal Pradesh") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:O");
} else if (region == "Jammu, Kashmir") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:P");
} else if (region == "Jharkhand") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:Q");
} else if (region == "Kerala") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:R");
} else if (region == "Kokan, Goa") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:S");
} else if (region == "Lakshadweep") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:T");
} else if (region == "Madhya Maharashtra") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:U");
} else if (region == "Maratwada") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:V");
} else if (region == "Nagaland, Manipur, Mizoram, Tripura") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:W");
} else if (region == "North Interior Karnataka") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:X");
} else if (region == "Orissa") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:Y");
} else if (region == "Punjab") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:Z");
} else if (region == "Rayalseema") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AA");
} else if (region == "Saurashtra, Kutch, Diu") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AB");
} else if (region == "South Interior Karnataka") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AC");
} else if (region == "Sub-Himalayan, West Bengal, Sikkim") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AD");
} else if (region == "Tamil Nadu, Pondicherry") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AE");
} else if (region == "Telengana") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AF");
} else if (region == "Uttaranchal") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AG");
} else if (region == "Vidarbha") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AH");
} else if (region == "West Madhya Pradesh") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AI");
} else if (region == "West Rajasthan") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AJ");
} else if (region == "West Uttar Pradesh") {
query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&range=A:AK");
}
query.send(handleQueryResponse);
};
function handleQueryResponse(response) {
var data = response.getDataTable();
var chartAreaHeight = data.getNumberOfRows() * 10;
var chartHeight = chartAreaHeight + 70;
var options = {
annotations: {
textStyle: {
fontSize: 10
}
},
legend: "none",
vAxis: {
title: "Year",
format: "0"
},
hAxis: {
title: "Rainfall (in mm)"
},
height: chartHeight,
chartArea: {
height: chartAreaHeight,
top: "100",
right: "100",
bottom: "100",
left: "100"
}
};
//Tests to check which region is selected
if (region == "Andaman & Nicobar Islands") {
options = {
title = "Andaman & Nicobar Islands"
}
} else if (region == "Arunachal Pradesh") {
options = {
title = "Arunachal Pradesh"
}
} else if (region == "Assam, Meghalaya") {
options = {
title = "Assam, Meghalaya"
}
} else if (region == "Bihar") {
options = {
title = "Bihar"
}
} else if (region == "Chattisgarh") {
options = {
title = "Chattisgarh"
}
} else if (region == "Coastal Karnataka") {
options = {
title = "Coastal Karnataka"
}
} else if (region == "Coastal Andhra Pradesh") {
options = {
title = "Coastal Andhra Pradesh"
}
} else if (region == "East Rajasthan") {
options = {
title = "East Rajasthan"
}
} else if (region == "East Madhya Pradesh") {
options = {
title = "East Madhya Pradesh"
}
} else if (region == "East Uttar Pradesh") {
options = {
title = "East Uttar Pradesh"
}
} else if (region == "Gangetic West Bengal") {
options = {
title = "Gangetic West Bengal"
}
} else if (region == "Gujarat Region, Dadra & Nagar Haveli") {
options = {
title = "Gujarat Region, Dadra & Naga Haveli";
}
} else if (region == "Haryana, Delhi, Chandigarh") {
options = {
title = "Haryana, Delhi, Chandigarh"
}
} else if (region == "Himachal Pradesh") {
options = {
title = "Himachal Pradesh"
}
} else if (region == "Jammu, Kashmir") {
options = {
title = "Jammu, Kashmir"
}
} else if (region == "Jharkhand") {
options = {
title = "Jharkhand"
}
} else if (region == "Kerala") {
options = {
title = "Kerala"
}
} else if (region == "Kokan, Goa") {
options = {
title = "Kokan, Goa"
}
} else if (region == "Lakshadweep") {
options = {
title = "Lakshadweep"
}
} else if (region == "Madhya Maharashtra") {
options = {
title = "Madhya Maharashtra"
}
} else if (region == "Maratwada") {
options = {
title = "Maratwada"
}
} else if (region == "Nagaland, Manipur, Mizoram, Tripura") {
options = {
title = "Nagaland, Manipur, Mizoram Tripura";
}
} else if (region == "North Interior Karnataka") {
options = {
title = "orth Interior Karnataka"
}
} else if (region == "Orissa") {
options = {
title = "Orissa"
}
} else if (region == "Punjab") {
options = {
title = "Punjab"
}
} else if (region == "Rayalseema") {
options = {
title = "Rayalseema"
}
} else if (region == "Saurashtra, Kutch, Diu") {
options = {
title = "Saurashtra, Kutch, Diu"
}
} else if (region == "South Interior Karnataka") {
options = {
title = "South Interior Karnataka"
}
} else if (region == "Sub-Himalayan, West Bengal, Sikkim") {
options = {
title = "Sub-Himalayan, West Bengal Sikkim";
}
} else if (region == "Tamil Nadu, Pondicherry") {
options = {
title = "Tamil Nadu, Pondicherry"
}
} else if (region == "Telengana") {
options = {
title = "Telengana"
}
} else if (region == "Uttaranchal") {
options = {
title = "Uttaranchal"
}
} else if (region == "Vidarbha") {
options = {
title = "Vidarbha"
}
} else if (region == "West Madhya Pradesh") {
options = {
title = "West Madhya Pradesh"
}
} else if (region == "West Rajasthan") {
options = {
title = "West Rajasthan"
}
} else if (region == "West Uttar Pradesh") {
options = {
title = "West Uttar Pradesh"
}
}
var formatter = new google.visualization.NumberFormat({
pattern: '#,##0.0'
});
formatter.format(data, 1);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1, {
calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation"
}]);
var chart = new google.visualization.BarChart(document.getElementById("chart"));
chart.draw(view, options);
window.addEventListener('resize', function() {
chart.draw(view, options);
}, false)
};
});
最佳答案
做了一些改变...
google.load
和 setOnLoadCallback
每次页面加载时只应调用一次value
属性添加到option
以避免过长的if
语句查询
以使用tq=
参数,它允许sql
语句,并且只返回需要的列,而不是整个范围编辑
.region
float: left;
更改为 text-align: left;
bar.groupWidth
hAxis.ticks
vAxis.ticks
请参阅以下工作片段...
// load google charts, version '45'. 'current' version throws error when loading DataView
google.charts.load('45', {
// callback function when google finished loading
'callback': function() {
jQuery(".region").change(drawChart);
// removed 'drawChart()', appears you want a selection before drawing
},
// packages used on this page
'packages': ['corechart']
});
function drawChart() {
// get the selected option value
var region = jQuery(".region").find(":selected").val();
// build query with select statement based on region value
var query = new google.visualization.Query("https://docs.google.com/spreadsheets/d/1wLbWMwwu_bXcpxm8TlkNtkR4gbeqz_o8CuRzdDQMUaM/gviz/tq?gid=799372846&tq=select A," + region);
// run query
query.send(handleQueryResponse);
};
function handleQueryResponse(response) {
// get data table
var data = response.getDataTable();
// create number formatter
var formatter = new google.visualization.NumberFormat({
pattern: '0'
});
// format first column
formatter.format(data, 0);
// create number formatter
var formatter = new google.visualization.NumberFormat({
pattern: '#,##0.0'
});
// format second column
formatter.format(data, 1);
// set chart area height
var chartAreaHeight = data.getNumberOfRows() * 12;
// set chart height
var chartHeight = chartAreaHeight + 70;
// set x-axis labels or 'ticks'
var xTicks = [];
// find max amount for ticks
var dataMax = google.visualization.data.group(
data,
// modifier column to find max on entire table
[{column: 0, type: 'string', modifier: function () {return '';}}],
// max column
[{column: 1, type: 'number', aggregation: google.visualization.data.max}]
);
// 'round up' to nearest 1000
var maxTick = Math.ceil(dataMax.getValue(0, 1) / 1000) * 1000;
// load ticks array
for (var i = 0; i <= maxTick; i = i + 1000) {
xTicks.push(i);
}
// build y-axis ticks, add every year, need to reduce font or increase height
var yTicks = [];
for (var i = 0; i < data.getNumberOfRows(); i++) {
yTicks.push(data.getValue(i, 0));
}
// chart options
var options = {
animation: {
startup: true,
easing: 'linear',
duration: 750
},
annotations: {
textStyle: {
fontSize: 7
}
},
title: jQuery(".region").find(":selected").text(),
legend: "none",
vAxis: {
title: "Year",
format: "0"
},
hAxis: {
title: "Rainfall (in mm)"
},
height: chartHeight,
chartArea: {
height: chartAreaHeight,
// use number for exact, string for percentage "100%"
top: 70,
right: 100,
bottom: 100,
left: 100
},
// set bar height
bar: {
groupWidth: 7
},
// set x-axis ticks
hAxis: {
ticks: xTicks
},
// set y-axis options
vAxis: {
// format for year
format: '0',
// text style, reduce font
textStyle: {
fontSize: 8
},
// tick marks
ticks: yTicks
}
};
// create data view from data table
var view = new google.visualization.DataView(data);
// add calculated column for annotations, 'current' version bombs here
view.setColumns([0, 1, {
calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation"
}]);
// create, draw chart
var chart = new google.visualization.BarChart(document.getElementById("chart"));
chart.draw(view, options);
// re-draw chart when the window resizes
// removed 'window.addEventListener' as may not work in older browsers
$(window).resize(function() {
chart.draw(view, options);
});
};
.text {
margin-bottom: 10px;
}
.region {
text-align: left;
}
button {
text-align: left;
margin-left: 10px;
}
#chart {
width: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div class="text">
Select a region below to know the annual rainfall in that region.
</div>
<div>
<select class="region">
<!-- like this better than 'optgroup', if selection must be made before draw -->
<option selected="selected" disabled>Please select a region...</option>
<option value="B">Andaman & Nicobar Islands</option>
<option value="C">Arunachal Pradesh</option>
<option value="D">Assam, Meghalaya</option>
<option value="E">Bihar</option>
<option value="F">Chattisgarh</option>
<option value="G">Coastal Karnataka</option>
<option value="H">Coastal Andhra Pradesh</option>
<option value="I">East Rajasthan</option>
<option value="J">East Madhya Pradesh</option>
<option value="K">East Uttar Pradesh</option>
<option value="L">Gangetic West Bengal</option>
<option value="M">Gujarat Region, Dadra & Nagar Haveli</option>
<option value="N">Haryana, Delhi, Chandigarh</option>
<option value="O">Himachal Pradesh</option>
<option value="P">Jammu, Kashmir</option>
<option value="Q">Jharkhand</option>
<option value="R">Kerala</option>
<option value="S">Kokan, Goa</option>
<option value="T">Lakshadweep</option>
<option value="U">Madhya Maharashtra</option>
<option value="V">Maratwada</option>
<option value="W">Nagaland, Manipur, Mizoram, Tripura</option>
<option value="X">North Interior Karnataka</option>
<option value="Y">Orissa</option>
<option value="Z">Punjab</option>
<option value="AA">Rayalseema</option>
<option value="AB">Saurashtra, Kutch, Diu</option>
<option value="AC">South Interior Karnataka</option>
<option value="AD">Sub-Himalayan, West Bengal, Sikkim</option>
<option value="AE">Tamil Nadu, Pondicherry</option>
<option value="AF">Telengana</option>
<option value="AG">Uttaranchal</option>
<option value="AH">Vidarbha</option>
<option value="AI">West Madhya Pradesh</option>
<option value="AJ">West Rajasthan</option>
<option value="AK">West Uttar Pradesh</option>
</select>
</div>
<div id="chart">
</div>
关于javascript - 谷歌图表不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38201668/
我的Angular-Component位于一个flexbox(id =“log”)中。可以显示或隐藏flexbox。 我的组件内部有一个可滚动区域,用于显示日志消息。 (id =“message-li
我真的很困惑 有一个 phpinfo() 输出: MySQL 支持 启用 客户端 API 版本 5.5.40 MYSQL_MODULE_TYPE 外部 phpMyAdmin 显示: 服务器类型:Mar
我正在研究这个 fiddle : http://jsfiddle.net/cED6c/7/我想让按钮文本在单击时发生变化,我尝试使用以下代码: 但是,它不起作用。我应该如何实现这个?任何帮助都会很棒
我应该在“dogs_cats”中保存表“dogs”和“cats”各自的ID,当看到数据时显示狗和猫的名字。 我有这三个表: CREATE TABLE IF NOT EXISTS cats ( id
我有一个字符串返回到我的 View 之一,如下所示: $text = 'Lorem ipsum dolor ' 我正在尝试用 Blade 显示它: {{$text}} 但是,输出是原始字符串而不是渲染
我无法让我的链接(由图像表示,位于页面左侧)真正有效地显示一个 div(包含一个句子,位于中间)/单击链接时隐藏。 这是我的代码: Practice
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 4 年前。 Improve this ques
最初我使用 Listview 来显示 oracle 结果,但是最近我不得不切换到 datagridview 来处理比 Listview 允许的更多的结果。然而,自从切换到数据网格后,我得到的结果越来越
我一直在尝试插入一个 Unicode 字符 ∇ 或 ▽,所以它显示在 Apache FOP 生成的 PDF 中。 这是我到目前为止所做的: 根据这个基本帮助 Apache XSL-FO Input,您
我正在使用 node v0.12.7 编写一个 nodeJS 应用程序。 我正在使用 pm2 v0.14.7 运行我的 nodejs 应用程序。 我的应用程序似乎有内存泄漏,因为它从我启动时的大约 1
好的,所以我有一些 jQuery 代码,如果从下拉菜单中选择了带有前缀 Blue 的项目,它会显示一个输入框。 代码: $(function() { $('#text1').hide();
当我试图检查 Chrome 中的 html 元素时,它显示的是 LESS 文件,而 Firefox 显示的是 CSS 文件。 (我正在使用 Bootstrap 框架) 如何在 Chrome 中查看 c
我是 Microsoft Bot Framework 的新手,我正在通过 youtube 视频 https://youtu.be/ynG6Muox81o 学习它并在 Ubuntu 上使用 python
我正在尝试转换从 mssql 生成的文件到 utf-8。当我打开他的输出 mssql在 Windows Server 2003 中使用 notepad++ 将文件识别为 UCS-2LE我使用 file
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我正在尝试执行单击以打开/关闭一个 div 的功能。 这是基本的,但是,点击只显示 div,当我点击“关闭”时,没有任何反应。 $(".inscricao-email").click(function
假设我有 2 张卡片,屏幕上一次显示一张。我有一个按钮可以用其他卡片替换当前卡片。现在假设卡 1 上有一些数据,卡 2 上有一些数据,我不想破坏它们每个上的数据,或者我不想再次重建它们中的任何一个。
我正在使用 Eloquent Javascript 学习 Javascript。 我在 Firefox 控制台上编写了以下代码,但它返回:“ReferenceError:show() 未定义”为什么?
我正在使用 Symfony2 开发一个 web 项目,我使用 Sonata Admin 作为管理面板,一切正常,但我想要做的是,在 Sonata Admin 的仪表板菜单上,我需要显示隐藏一些菜单取决
我试图显示一个div,具体取决于从下拉列表中选择的内容。例如,如果用户从列表中选择“现金”显示现金div或用户从列表中选择“检查”显示现金div 我整理了样本,但样本不完整,需要接线 http://j
我是一名优秀的程序员,十分优秀!