Answer the question
In order to leave comments, you need to log in
How to implement parallax effect in this plugin?
stephband.info/jparallax
{
"manifest_version": 2,
"name": "Режим чтения",
"description": "Для чтения содержимого страницы",
"version": "1.0",
"icons": {
"128": "128.png"
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"permissions": [
"activeTab",
"tabs"
],
"browser_action": {
"default_title": "Browser reader",
"default_icon": "16.png"
}
}
chrome.browserAction.onClicked.addListener( function( tab ) {
chrome.tabs.executeScript( null, { file : "jquery-2.1.1.min.js" }, function () {
chrome.tabs.executeScript( null, { file : "content_script.js" })
})
});
document.body.style.backgroundColor="#fff";
function parser(tagName) {
function writeClass() {
$("p,:header").attr({ class: "readtext" });
}
writeClass();
var res = '';
$(tagName).find('.readtext').each(function(){
res += "<p>" + $(this).text() + "</p>";
});
return res;
}
var text = parser("body");
$('body').empty().append('<div id="reader" style=" width: 100%; height: auto; background: #fff; padding: 60px; font-size: 15px; padding-top: 30px;">'+text+'</div>');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question