Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
load-hd
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
tools
load-hd
Commits
2e24ce3b
Commit
2e24ce3b
authored
Dec 14, 2015
by
Vadym Gidulian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit
parents
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
0 deletions
+49
-0
README.md
README.md
+26
-0
jquery.load-hd.min.js
dist/jquery.load-hd.min.js
+5
-0
jquery.load-hd.js
src/jquery.load-hd.js
+18
-0
No files found.
README.md
0 → 100644
View file @
2e24ce3b
# Load HD
This jQuery plugin will load HD version of content and replace preview.
### Getting started
It should be applied to content which will be replaced by its HD version. The only parameter is an attribute that stores link to HD version:
```
$('img[hd-src]').loadHD('hd-src');
```
After that content will be replaced by its HD version.
### Example
*
In HTML:
```
<img src="poster-preview.png" hd-src="poster.png">
```
*
In JS:
```
$(function () {
$('img[hd-src]').loadHD('hd-src');
});
```
dist/jquery.load-hd.min.js
0 → 100644
View file @
2e24ce3b
/**
* Vadym Gidulian, GVIA Group
*/
(
function
(
$
){
$
.
fn
.
loadHD
=
function
(
a
){
return
this
.
each
(
function
(){
var
b
=
$
(
this
);
var
c
=
b
.
attr
(
a
);
var
d
=
new
Image
();
d
.
src
=
c
;
d
.
onload
=
function
(){
b
.
attr
(
"src"
,
c
);};});};}(
jQuery
));
\ No newline at end of file
src/jquery.load-hd.js
0 → 100644
View file @
2e24ce3b
/**
* Vadym Gidulian, GVIA Group
*/
(
function
(
$
)
{
$
.
fn
.
loadHD
=
function
(
hdSrcAttr
)
{
return
this
.
each
(
function
()
{
var
preview
=
$
(
this
);
var
hdSrc
=
preview
.
attr
(
hdSrcAttr
);
var
image
=
new
Image
();
image
.
src
=
hdSrc
;
image
.
onload
=
function
()
{
preview
.
attr
(
'src'
,
hdSrc
);
};
});
};
}(
jQuery
));
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