你能告诉我如何实现点沿圆的移动吗?
无法通过关键帧实现点的移动。我将不胜感激一个示例实现。
请告诉我,如何使用jquery在一行中获取所有块的值(名称+价格),同时考虑到它们是动态添加的并且我们不知道它们的数量?
收到的线路格式:电车 - 28000 卢布;汽车 - 15000 卢布;等等
我假设您需要将数据写入数组,但我不知道如何。
html 标记示例:
<div class="sub-products__row">
<div class="sub-products__img">
<img data-src='../images/dest/single-product.jpg' class='lazy' alt=''>
</div>
<div class="sub-products__text">
<div class="sub-products__name">Тележка ЗУБР 38750-60 ЭКСПЕРТ</div>
<div class="sub-products__price-wrap">
<div class="sub-products__price">
<span class="sub-products__sum" data-price="300">300</span> ₽
</div>
</div>
</div>
</div>
<div class="sub-products__row">
<div class="sub-products__img">
<img data-src='../images/dest/single-product.jpg' class='lazy' alt=''>
</div>
<div class="sub-products__text">
<div class="sub-products__name">Тележка ЗУБР 38750-60 ЭКСПЕРТ</div>
<div class="sub-products__price-wrap">
<div class="sub-products__price">
<span class="sub-products__sum" data-price="300">300</span> ₽
</div>
<div class="sub-products__checked">
</div>
</div>
</div>
我有两个格式为 02/20/1992 的日期,如何计算它们之间的天数差异?
我不知道如何实现这样的滑块?我翻遍了一堆抄袭 - 我没有找到合适的。滑块示例在这里https://www.flatstack.com/team/

有一个任务:在单选按钮的基础上制作标记过滤器。在网上,我只找到了一个带有隐藏标记的复选框的示例。我请求您建议或展示一个带有收音机的实现示例。
var gmarkers1 = [];
var markers1 = [];
var infowindow = new google.maps.InfoWindow({
content: ''
});
// Our markers
markers1 = [
['0', 'Title 1', 52.4357808, 4.991315699999973, ['car', 'second']],
['1', 'Title 2', 52.4357808, 4.981315699999973, ['third']],
['2', 'Title 3', 52.4555687, 5.039231599999994, ['car', 'third']],
['3', 'Title 4', 52.4555687, 5.029231599999994, ['second']]
];
markerCount = markers1.length
/** Function to init map */
function initialize() {
var center = new google.maps.LatLng(52.4357808, 4.991315699999973);
var mapOptions = {
zoom: 12,
center: center,
mapTypeId: google.maps.MapTypeId.TERRAIN
};
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
for (i = 0; i < markerCount; i++) {
addMarker(markers1[i]);
}
}
/** Function to add marker to map */
function addMarker(marker) {
var category = marker[4];
var title = marker[1];
var pos = new google.maps.LatLng(marker[2], marker[3]);
var content = marker[1];
marker1 = new google.maps.Marker({
title: title,
position: pos,
category: category,
map: map
});
gmarkers1.push(marker1);
// Marker click listener
google.maps.event.addListener(marker1, 'click', (function (marker1, content) {
return function () {
console.log('Gmarker 1 gets pushed');
infowindow.setContent(content);
infowindow.open(map, marker1);
map.panTo(this.getPosition());
map.setZoom(15);
}
})(marker1, content));
}
// Function on Change of checkbox
updateView = function (element) {
if (element) {
//Get array with names of the checked boxes
checkedBoxes = ([...document.querySelectorAll('input[type=checkbox]:checked')]).map(function(o) { return o.id; });
console.log(checkedBoxes);
for (i = 0; i < markerCount; i++) {
marker = gmarkers1[i];
console.log(marker.category)
//Filter to show any markets containing ALL of the selected options
if(typeof marker.category == 'object' && checkedBoxes.every(function (o) {
return (marker.category).indexOf(o) >= 0;})){
marker.setVisible(true);
}
else {
marker.setVisible(false);
}
}
}
else {
console.log('No param given');
}
}
// Init map
initialize();
#map-canvas {
width: 500px;
height: 500px;
}
<script src="https://maps.googleapis.com/maps/api/js?key=&v=3&language=ee&dummy=dummy.js"></script>
<div id="map-canvas"></div>
<div id="options">
<input type="checkbox" id="car" onchange="updateView(this);"/> Car
<input type="checkbox" id="second" onchange="updateView(this);"/> Second
<input type="checkbox" id="third" onchange="updateView(this);"/> Third
</div>
我有一列有许多 50% 宽度的块(一行 2 个)。
我需要每 3 和 4 块更改一次颜色。
这是一个例子:
.row {
width: 400px;
display: flex;
flex-wrap: wrap;
}
.row div {
width: 48%;
height: 100px;
border: 1px solid #000;
}
.row div:nth-child(3n) {
}
<div class="row">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
你能告诉我如何实现块可见性跟踪吗?
我需要将活动类添加到相应块的 li 并将其从其余部分中删除。
$('.blocks .section').each(function(index, element) {
$(this).attr('data-block', index);
$('.navigation').append('<li class="scrollto" data-block="' + index + '">Блок ' + $(element).html() + '</li>')
});
$(document).on('click', '.navigation .scrollto', function() {
var block_id = $(this).attr('data-block'),
block = $('[data-block="' + block_id + '"]:not(.scrollto)');
if (block.offset() !== undefined) {
$('html, body').animate({
scrollTop: block.offset().top
}, 1000, 'swing', function() {
// здесь код если надо что-то делать после прокрутки
});
}
return false;
});
.section {
display: block;
height: 350px;
background: red;
margin-bottom: 50px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul class="navigation">
</ul>
<div class="blocks">
<div class="section">
1
</div>
<div class="section">
2
</div>
<div class="section">
3
</div>
</div>
我需要使用 .blocks 类计算块中的块数,并根据它们的数量创建指向这些元素的相同数量的链接。每个链接都会滚动到相应的元素。
请告诉我如何实施?我会非常感谢。
<div class="blocks">
<div class="section">
1
</div>
<div class="section">
2
</div>
<div class="section">
3
</div>
</div>
<ul class="navigation">
<li><a href="">Блок 1</a></li>
<li><a href="">Блок 2</a></li>
<li><a href="">Блок 3</a></li>
</ul>
请告诉我,在我的情况下,如何将任意数量的 PX 添加到块的初始高度?
$(function() {
var height = $('.about-main').height(); //получаем высоту одного элемента
$('.form-wrap').height(height); //записываем высоту другому элементу
});
我需要在高度变量中再添加 50px。
如何使用两个不同的模板输出后循环?我需要所有偶数都采用一种模式 - 奇数与另一种模式。我会很感激你的帮助。
我有 3 个字段:名称、价格、TV tablepriceitem 中的链接
我需要检查链接字段的完整性并根据此显示不同的模板。我喜欢这样:
[[getImageList?
&docid=`[[*id]]`
&tvname=`tablepriceitem`
&tpl=`[[+linkitem:is=`0`:then=`link.tpl`:else=`link2.tpl`]]`
]]
但是我的支票不起作用。为什么?我将不胜感激。
我需要输出某些资源列表的链接。我喜欢这样:
testpole带有多个列表。@SELECT pagetitle, id FROM modx_site_content WHERE parent=7但是后来我不知道如何url在模板中显示这些资源...请告诉我,这怎么办?
另一个问题是如何将它与 MIGX 连接起来。我需要在 MIGX 中添加一个包含一种资源的字段,并在其旁边写上价格。要单击“添加项目”,请选择一个资源,通过第二个值为其分配价格并将其显示在表中的块中。
我想出了如何链接字段,我只是将 {"field":"res","caption":"Select resources","inputTV":"testpole"} 添加到 MIGX 表单,但如何显示它们 - 没有.

我有一个资源目录:
-Автомобили (7)
--Легковые (8)
---BMW (9)
---AUDI (10)
--Грузовые (11)
---ВАЗ (12)
我需要显示来自汽车和卡车的 ID 为 7 的父项的子资源的资源列表。即BMW、AUDI、VAZ等...
我只能输出整个列表,但这并不是您所需要的:
[[pdoResources?
&parents=`7`
&depth=`5`
&tpl=`priceblock`
&sortby=`{"parent":"ASC","menuindex":"ASC"}`
&idx=`1`
&includeTVs=`pricerub,pricename`
]]
有可能这样做吗?还是需要手动模板化,指定每个子资源的ID?
我有一个这样的资源树(在括号中是它们的 ID)
-Автомобили
--Легковые(7)
---BMD(8)
---AUDI(9)
--Грузовые
---Ваз
所有(列出)ID 为 7 的父资源及其子资源上的这些参数。
我正在尝试这样做,但似乎没有任何效果:
编码:
[[pdoResources?
&parent=`7`
&depth=`0`
&tpl=`priceblock`
&includeTVs=`1`
&processTVs=`1`
]]
tpl:
[[*pricerub]]
我究竟做错了什么?只显示单个值,不显示所有资源。
我最近刚切换到 MODX,遇到了这个问题:
我通过电视参数在我显示的header中拉取站点header,电话,地址等信息。但据我了解,这些参数与一个资源(主页面、内部页面等)相关联,我需要将此信息显示在所有页面上。请告诉我最好的方法是什么?
也许您可以显示特定资源的电视参数?assortment里面有migx,但是不太适合单个字段,适合添加字段(我理解的)。
总的来说,我希望得到足够的提示 :)
我是 PHP 的新手,不知道如何两次使用单引号(在 echo 和代码中)。
这是一个例子:
echo '<div class="item" style="background-image: url("' . esc_url($large_image_url[0]) . '");">';
echo '</div>';
我需要 background-image: url(" - 而不是双引号,而是使用单引号。但是如果你放下它,代码就会离开。
我希望你理解我,因为我不知道如何表达我对这件事的想法..
我有一个固定的列表。高度和滚动,带有标签元素。单击标签元素时,单击的元素旁边会出现一个按钮。
我需要这个按钮在列表之外,但在元素的前面。
我们需要一些解决方案,即使是拐杖也可以:(
这是您需要的:
这是我的代码:
.check {
width: 150px;
height: 100px;
border: 1px solid #000;
overflow-y: scroll;
}
.check label {
display: block;
position: relative;
}
.box-button {
display: none;
position: absolute;
right: -10px;
top: 0;
background-color: #fc0;
box-shadow: 1.4px 1.4px 4px rgba(0, 0, 0, 0.35);
border: none;
color: #424242;
padding: 0 5px;
font-size: 14px;
font-weight: 400;
line-height: 28px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<div class="check">
<label for="check-1">
<input id="check-1" class="element-checkbox" name="check-1" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<label for="check-2">
<input id="check-2" class="element-checkbox" name="check-2" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<label for="check-3">
<input id="check-3" class="element-checkbox" name="check-3" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<label for="check-4">
<input id="check-4" class="element-checkbox" name="check-4" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<label for="check-5">
<input id="check-5" class="element-checkbox" name="check-5" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<label for="check-6">
<input id="check-6" class="element-checkbox" name="check-6" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<button class="box-button">Показать</button>
</div>
<div class="check">
<label for="check-7">
<input id="check-7" class="element-checkbox" name="check-7" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<label for="check-8">
<input id="check-8" class="element-checkbox" name="check-8" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<label for="check-9">
<input id="check-9" class="element-checkbox" name="check-9" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<label for="check-10">
<input id="check-10" class="element-checkbox" name="check-10" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<label for="check-11">
<input id="check-11" class="element-checkbox" name="check-11" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<label for="check-12">
<input id="check-12" class="element-checkbox" name="check-12" value="Motul" type="checkbox">
<span>Motul</span>
</label>
<button class="box-button">Показать</button>
</div>
<script>
$(".check label").click(function() {
var $parentBox = $(this).closest('.check');
$('.box-button', $parentBox).show();
clearTimeout($parentBox.data('timeout'));
$parentBox.data('timeout', setTimeout(function() {
$('.box-button', $parentBox).hide();
}, 4000));
$('.box-button', $parentBox).appendTo(this);
});
</script>