using UnityEngine;
using UnityEngine.UI;
public class Example : MonoBehaviour
{
public GridLayoutGroup gridLayoutGroup;
private void Start()
{
gridLayoutGroup.cellSize = new Vector2(200, 200);
}
}
public void OnDrag(PointerEventData eventData)
{
transform.position += (Vector3)eventData.delta;
}
<div id="clock" class="example for you"> </div>
var elem = document.querySelector("#clock")
//Выведем классы
console.log(elem.classList); //DOMTokenList ["example", "for", "you"]
//Добавим классы
elem.classList.add("ok", "understand");
console.log(elem.classList); //DOMTokenList ["example", "for", "you", "ok", "understand"]
//Переключим классы
elem.classList.toggle("you");
elem.classList.toggle("he");
console.log(elem.classList); //DOMTokenList ["example", "for", "ok", "understand", "he"]
//Проверим класс
console.log(elem.classList.contains("example")); //true
console.log(elem.classList.contains("lol")); //false
//И удалим классы
elem.classList.remove("example", "for", "understand", "he");
console.log(elem.classList); //DOMTokenList ["ok"]
<div id="popup_expert" style="" class="dt active" onclick="this.classList.remove('active'); this.classList.add('no-active');">
$string = "10 01 32 05 54";
$numbers = explode(" ", $string);
$filtered = array_filter($numbers , function($number) {
return in_array($number, ["01", "02", "03", "04", "05"]);
});
<?php
$re = '/<p class="number">(.+)<\/p>/';
$str = '<div class="winning_numbers cleared">
<ul>
<li class="girl1 number4 ">
<p class="number">4</p>
</li>
<li class="girl2 number7 ">
<p class="number">7</p>
</li>
<li class="girl3 number5 ">
<p class="number">5</p>
</li>
<li class="girl4 number8 ">
<p class="number">8</p>
</li>
<li class="girl5 number26 ">
<p class="number">26</p>
</li>
<li class="girl6 number3">
<div class="hider">
<p class="number">3</p>
</div>
</li>
</ul>
</div>';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);