Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
ede2f2c4
Commit
ede2f2c4
authored
Dec 10, 2009
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made some minor formatting changes to the access function.
parent
80913618
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
core.js
src/core.js
+9
-10
No files found.
src/core.js
View file @
ede2f2c4
...
...
@@ -657,31 +657,30 @@ function evalScript( i, elem ) {
// Mutifunctional method to get and set values to a collection
// The value/s can be optionally by executed if its a function
function
access
(
elems
,
key
,
value
,
exec
,
fn
)
{
var
l
=
elems
.
length
;
var
l
ength
=
elems
.
length
;
// Setting many attributes
if
(
typeof
key
===
"object"
)
{
for
(
var
k
in
key
)
{
access
(
elems
,
k
,
key
[
k
],
exec
,
fn
);
}
for
(
var
k
in
key
)
{
access
(
elems
,
k
,
key
[
k
],
exec
,
fn
);
}
return
elems
;
}
// Setting one attribute
if
(
value
!==
undefined
)
{
if
(
value
!==
undefined
)
{
// Optionally, function values get executed if exec is true
exec
=
exec
&&
jQuery
.
isFunction
(
value
);
for
(
var
i
=
0
;
i
<
l
;
i
++
)
{
var
elem
=
elems
[
i
],
val
=
exec
?
value
.
call
(
elem
,
i
)
:
value
;
fn
(
elem
,
key
,
val
);
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
fn
(
elems
[
i
],
key
,
exec
?
value
.
call
(
elems
[
i
],
i
)
:
value
);
}
return
elems
;
}
// Getting an attribute
return
l
?
fn
(
elems
[
0
],
key
)
:
null
;
return
l
ength
?
fn
(
elems
[
0
],
key
)
:
null
;
}
function
now
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment