嘿,我正在研究css滑块它工作正常,没有js只有css但我想为滑块的导航按钮制作一个js脚本我的意思是我想制作一个可以向左或向右滑动内容的js脚本通过单击左或右按钮,它必须循环我的意思是,如果你单击按钮一次然后它必须向左或向右滑动内容每次100%,最大宽度是我想要滑动的内容的1000%可以有人请帮我这个
Function Debug-String {
param(
[Parameter(ValueFromPipeline, Mandatory)]
[string] $String
,
[switch] $CaretNotation
)
begin {
# \p{C} matches any Unicode control character, both inside and outside
# the ASCII range; note that tabs (`t) are control character too, but not spaces.
$re = [regex] '\p{C}'
}
process {
$re.Replace($String, {
param($match)
$handled = $False
if (-not $CaretNotation) {
# Translate control chars. that have native PS escape sequences into them.
$handled = $True
switch ([Int16] [char] $match.Value) {
0 { '`0'; break }
7 { '`a'; break }
8 { '`b'; break }
12 { '`f'; break }
10 { '`n'; break }
13 { '`r'; break }
9 { '`t'; break }
11 { '`v'; break }
default { $handled = $false }
} # switch
}
if (-not $handled) {
switch ([Int16] [char] $match.Value) {
10 { '$'; break } # cat -A / cat -e visualizes LFs as '$'
# If it's a control character in the ASCII range,
# use caret notation too (C0 range).
# See https://en.wikipedia.org/wiki/Caret_notation
{ $_ -ge 0 -and $_ -le 31 -or $_ -eq 127 } {
# Caret notation is based on the letter obtained by adding the
# control-character code point to the code point of '@' (64).
'^' + [char] (64 + $_)
break
}
# NON-ASCII control characters; use the - PS Core-only - Unicode
# escape-sequence notation:
default { '`u{{{0}}}' -f ([int16] [char] $_).ToString('x') }
}
} # if (-not $handled)
}) # .Replace
} # process
}
我想滑动这一部分:
<#
.SYNOPSIS
Outputs a string in diagnostic form.
.DESCRIPTION
Prints a string with normally hidden control characters visualized.
Common control characters are visualized using PowerShell's own escaping
notation by default, such as
"`t" for a tab, "`n" for a LF, and "`r" for a CR.
Any other control characters in the ASCII range (C0 control characters)
are represented in caret notation (see https://en.wikipedia.org/wiki/Caret_notation).
If you want all ASCII range control characters visualized using caret notation,
except LF visualized as "$", similiar to `cat -A` on Linux, for instance,
use -CaretNotation.
Non-ASCII control characters are visualized by their Unicode code point
in the form `u{<hex>}, where <hex> is the hex. representation of the
code point with up to 6 digits; e.g., `u{85} is U+0085, the NEXT LINE
control char.
.PARAMETER CaretNotation
Causes LF to be visualized as "$" and all other ASCII-range control characters
in caret notation, similar to `cat -A` on Linux.
.EXAMPLE
PS> "a`ab`t c`0d`r`n" | Debug-String
a`ab`t c`0d`r`n
.EXAMPLE
PS> "a`ab`t c`0d`r`n" | Debug-String -CaretNotation
a^Gb^I c^@d^M$
#>
请帮帮我
答案 0 :(得分:0)
您可以为img
元素中的任何div
设置每个div
标记1 img
,然后在js中声明一个函数并使用onclick
调用它EX的事件:单击右键将1发送到函数并保留-1。
那么你可以为应该显示的每个div添加类。