I am developing an app where i need to implement pagination for changing of images. The code i am using is.
index.html
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="css/demo.css" type="text/css" media="screen" />
</head>
<body>
<div class="imagesScreen" id="imagesScreen">
<img style="border-radius:10px;height:70px;width:70px;margin:10px;" src="http://farm7.static.flickr.com/6052/6279000273_218313c876.jpg" />
<img style="border-radius:10px;height:70px;width:70px;margin:10px;" src="http://farm7.static.flickr.com/6052/6279000273_218313c876.jpg" />
<img style="border-radius:10px;height:70px;width:70px;margin:10px;" src="http://farm7.static.flickr.com/6052/6279000273_218313c876.jpg" />
<img style="border-radius:10px;height:70px;width:70px;margin:10px;" src="http://farm7.static.flickr.com/6052/6279000273_218313c876.jpg" />
<img style="border-radius:10px;height:70px;width:70px;margin:10px;" src="http://farm7.static.flickr.com/6052/6279000273_218313c876.jpg" />
<img style="border-radius:10px;height:70px;width:70px;margin:10px;" src="http://farm7.static.flickr.com/6052/6279000273_218313c876.jpg" />
<img style="border-radius:10px;height:70px;width:70px;margin:10px;" src="http://farm7.static.flickr.com/6052/6279000273_218313c876.jpg" />
<img style="border-radius:10px;height:70px;width:70px;margin:10px;" src="http://farm7.static.flickr.com/6052/6279000273_218313c876.jpg" />
<img style="border-radius:10px;height:70px;width:70px;margin:10px;" src="http://farm7.static.flickr.com/6052/6279000273_218313c876.jpg" />
<img style="border-radius:10px;height:70px;width:70px;margin:10px;" src="http://farm7.static.flickr.com/6052/6279000273_218313c876.jpg" />
</div>
</body>
</html>
Here as per above code i am having two buttons in footer tag(not mentioned code above). in each page i want to display around 6-10 images & when i click next button or previous button in the same page data needs to be change using Pagination technique. Here i took static data, but in my app that data comes from server during runtime. so, i need to create dynamic data.
As per the link Pagination link here getting one image at a time. but i want around 6-10 images as per the below picture. when i click on next button page need to be same but data must change as per the Pagination link.
Can anyone please help me with this how to get that type of pagination technique & how to create dynamic data of div & image tags( & tags), as i want the view as per the below blackberry image shown.
Thanks in advance..
It's a fairly logical feature. First, I'm assuming you're pulling data with SQL using a limit
SELECT * FROM images ORDER BY time DESC LIMIT 0, 9
I'm assuming you're using PHP for the server-side scripting, if not, try accommodating this to your language.
Let's say we have a GET value that uses page=123 for the page ID, of course 123 is an arbitrary number; we need to pull the images starting at page number * items per page so for example, at page 2, we get 2 * 9 which is 18, so our first picture should be picture 18. Now I just go on taking the correct LIMIT clause in the SQL query:
PHP:
$start = $_GET['page'] * $items_per_page;
SQL:
SELECT * FROM `images` ORDER BY `time` DESC LIMIT {$start}, {$items_per_page}
That's the basic gist of it.
You can try the below URL as a reference.
http://cssglobe.com/lab/easypaginate/02.html
Thanks
Related
How do I show the file name in view? Currently, I just hardcoded the name of the file on view.
Can someone assist me? thank you very much
Here my code:
<li>
#if (Model.Picture2 != null)
{
base2 = Convert.ToBase64String(Model.Picture2);
var picture2_data = base2.Substring(0, 5);
if (picture2_data == "JVBER")//PDF
{
var downloadTag = "PDPA" + Model.SenderID;
imgSrc2 = String.Format("data:application/pdf;base64,{0}", base2);
<br>
<a download=#downloadTag class="fa fa-file-pdf-o" style="font-size:18px;color:red" href=#imgSrc2></a>
<a download=#downloadTag href=#imgSrc2 title='PDPA'>PDPA</a>
<br />
}
else
{
base2 = Convert.ToBase64String(Model.Picture2); imgSrc2 = String.Format("data:image/gif;base64,{0}", base2);
<a class="fancybox-buttons" rel="fancybox-button" data-lightbox="button" href="#imgSrc2" title="PDPA"><img src="#imgSrc2" style="max-width:100px; max-height:100px;" alt="" /></a>
}
}
</li>
View
Your code has a few flaws and not exactly clear what your aiming for.
The parts that work would for a pdf look like this (however I am using a png for the pdf as its much faster/simpler as one line of data. It is not a good idea to have multiple references to a single dataURL only one should be needed.
this line works <a download=#downloadTag href=#imgSrc2 title='PDPA'>PDPA</a>
because it is PDPA
this one does not work
<a download=#downloadTag class="fa fa-file-pdf-o" style="font-size:18px;color:red" href=#imgSrc2></a>
because you have nothing visible between >hello world</a>
the last one more difficult to test but also same needs>something</a><
perhaps your aiming for something like
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='icon' href='https://css-tricks.com/favicon.svg' type='image/svg+xml'>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<body>
<a href="data:application/pdf;base64,JVBERi0xLjcNJeLjz9MNCjEgMCBvYmoNPDwvUGFnZXMgMiAwIFIvVHlwZS9DYXRhbG9nPj4NZW5kb2JqDTMgMCBvYmoNPDwvQ3JlYXRpb25EYXRlKEQ6MjAxNTA3MDExMTI0NDcrMDInMDAnKS9DcmVhdG9yKFBERiBDcmVhdG9yIGh0dHA6Ly93d3cucGRmLXRvb2xzLmNvbSkvTW9kRGF0ZShEOjIwMjIwNjA3MTgzNjAyKzAyJzAwJykvUHJvZHVjZXIoMy1IZWlnaHRzXDIyMiBQREYgT3B0aW1pemF0aW9uIFNoZWxsIDYuMC4wLjAgXChodHRwOi8vd3d3LnBkZi10b29scy5jb21cKSk+Pg1lbmRvYmoNNCAwIG9iag08PC9Bbm5vdHMgMTMgMCBSL0NvbnRlbnRzIDUgMCBSL01lZGlhQm94WzAgMCA2MTIgNzkyXS9QYXJlbnQgMiAwIFIvUmVzb3VyY2VzPDw+Pi9UeXBlL1BhZ2U+Pg1lbmRvYmoNNSAwIG9iag08PC9MZW5ndGggMT4+DXN0cmVhbQogCmVuZHN0cmVhbQ1lbmRvYmoNOSAwIG9iag08PC9CQm94WzAgMCA2MTIgMTQ4XS9GaWx0ZXIvRmxhdGVEZWNvZGUvRm9ybVR5cGUgMS9MZW5ndGggNDEvUmVzb3VyY2VzPDwvUHJvY1NldFsvUERGIC9UZXh0IC9JbWFnZUIgL0ltYWdlQyAvSW1hZ2VJXS9YT2JqZWN0PDwvSW0wIDExIDAgUj4+Pj4vU3VidHlwZS9Gb3JtL1R5cGUvWE9iamVjd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/BxYbRdV68K/Ajv/3PnB3/dPdw78Tg4HAIx8iTLC48Xh8gLlR97heR+5Msy9nnk4hL8SxRLeVTAcDVz0s/9qYZn1XaV0RPCKSOfs/RgihfoT7XuJuTR2iZBPJ/P9Dyipj0ij+MY+0d7qsmbKOlL+Y+wL+VF2eWP6iSxL6VXSCuRU4YE+lIm0+XXb9eh07w1B2kTziinoze+a1Q+IYIyKkiWNlnaNVJDZ19qNSFvUf1JimTv3jPFQZel2GQpDltkLq5Ubrc8jCgTMBaMhmMBPg9o4AsYhxEV8R7XT4cfzqJVaqN66w6lfWkUXhEcrtkwdcuoGMWCj4HR4cRjFkb+Hjetnj111pzm0krnJ7Gt9uSTNV5XvSpvaEYSMgDk04U7t7JpVOFd/kNdadWRhGx3O/JuGdjtyJ78cnEzeJlqbWyWpSl+B5ZlvwFulOXiCmVuZHN0cmVhbQ1lbmRvYmoNNiAxIG9iag08PC9EZWNvZGVQYXJtczw8L0NvbHVtbnMgNC9QcmVkaWN0b3IgMTI+Pi9GaWx0ZXIvRmxhdGVEZWNvZGUvSURbKFwwMzQ1XDAwMFwzMTJcMjM3cjJcMjcxflwwMTZcMzYzXDM2N1wyMTFcMzUwXDI2N1wzNjIpICglTFwyMTVcMDI1P2VdSVwyMjReXDI1NWhcMzMwXDAwMVwzNDBcMDIxKV0vSW5mbyAzIDAgUi9MZW5ndGggNzcvUm9vdCAxIDAgUi9TaXplIDE2L1R5cGUvWFJlZi9XWzEgMiAxXT4+DXN0cmVhbQp4nBXLsQ1AUBRA0fvuAiRqlajNozABmxhAYQA7SUxgA8V/8pvTHQEM2krBZELiQdiQsQ/zXlJpwowrjZw1PYt0K8b7YQ5HbTs/XGYSdwplbmRzdHJlYW0NZW5kb2JqDXN0YXJ0eHJlZg05ODkxDSUlRU9GCg=="
button class="w3-btn w3-white w3-border w3-border-red w3-text-red w3-round-large"
Download="ABC.pdf" >Click me to Download<br>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIC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sceZ25DJEUJZDQiaUogpbR65ers7dlyFSGQUV25VF4ot331vgNTaDk9Xm/77OLf9+PX+/IkngXO9gtkdFcjKend7U0Uji3WU72mR2YTbetMkNGMtPC+7+vATxQCeaLF9BgpiHfeHf8MQCDZzBDERARyV6npkT2IUu+8MugUEUgPNaKodYb95+dEX+P1Y9nDP0kgd9yZHqUWzJNn4e/PvXtfzsby/fEJIhFITVlPwv287RKxvLvtM/+fnECuOjM97iy6Xgvo6VR5NcHU+EkgV5T6C7UZn01LTJUJCaSVjFG8UzqWkb73FwI56+pCGXhR/OXJBY4TPAYCKWmCBXHKKt/nJpBzXJC4LFfzfuKAdWkC+c1Ce2xitlg//QzjUyTiWIJAts02irdssUY6601z6wby7tdCLX5+WDOQJ282IKClrHUM8vRCQ3EsZ50JYuFzwxoT5OyWSkS8mH+CiIMH5g7E+Q0emjeQKxPB9OCNOQMRB4XMF4g4KGi+QN6Z9H2bqGuuQDK89xRTmSuQd2ytuGmeQJzvoIJ5AjlDHFw0x6Umn6aH3w7kpvkniDh4YO5AxMFDcwcSEQcnzBHI1cUuDk6a4yB92/xGIFXME8i313cmFwUPzLHFekccPDR3IPCQQCAgEAgIBAICgYBAICAQCAgEAgKBgEAgIBAICAQCAoFArsvdvdshyZggEBAIBOoF4peV6KXg2jNBICAQCAgEAnUDcRxCa4XXnAnCPCo8IdcPxBRhYPtxNDx57Uw5NVR8Em67xTJNKK3ymmo7QWAwDtIhIBAICAQCAoGAQCAgEAgIBAICgYBAICAQCPwLH2kfzgOE8PAAAAAASUVORK5CYII="
width="100px" height="100px">
ABC.pdf</a>
you can replace the image with font icon
</body>
</html>
so like this but use pdf for first entry and an image or font icon for second,
<i class="fa fa-file-pdf-o" style="font-size:18px;color:red" aria-hidden="true"></i>
IF the files are on the server then on the server CPU you can program a means to provide custom icons
however converting just one pdf cover page to an image requires a powerful binary converter as javascript is limited and not always available. Here I can use a one line scripted conversion in irfanView without Ghost Script but most servers can run a single GS command
I am making a simple website which changes the image displayed when a button is clicked. But my code doesn't seem to be working as when I click on the button 'Click!' the alt text gets displayed instead of the image changing.The source of the images is perfectly fine, as when I use the same source outside the script the images show up.
<head>
<title>Pic Change</title>
<meta charset="utf-8">
<meta name="Pic Change">
<meta name="keywords" content="face,PES">
<meta name="author" content="Thalle">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
</head>
<body class="body" style="background-color:#4682B4">
<script>
function display(whichimage){
if(whichimage == 0){
document.getElementById('Click').src="C:\.....\Memes\Animals\initial.jpeg"
}
else{
document.getElementById('Click').src="C:\.....\Memes\Animals\Whenlife.jpeg"
}
}
</script>
<image id="Click" src="C:\......\Memes\Animals\initial.jpg" alt="Click Button to click picture" style="width:300px;height:300px" >
<p>
<button type="button" onclick="display(1)">Click!</button>
<button type="button" onclick="display(0)">Reset</button>
</p>
</body>
</html>
The code is fine, you just forgot the file:// before the start. This code shows that when you give a working image src in your code, it will work just fine. Also, don't use files from your disk on Stack Overflow, it gives out private information that you probably don't want on the web.
<head>
<title>Pic Change</title>
<meta charset="utf-8">
<meta name="Pic Change">
<meta name="keywords" content="face,PES">
<meta name="author" content="Thalle">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
</head>
<body class="body" style="background-color:#4682B4">
<script>
function display(whichimage){
if(whichimage == 0){
document.getElementById('Click').src="http://www.iconarchive.com/download/i86425/martin-berube/flat-animal/duck.ico"
}
else{
document.getElementById('Click').src="https://maxcdn.icons8.com/Share/icon/Animals//duck1600.png"
}
}
</script>
<image id="Click" src="http://www.iconarchive.com/download/i86425/martin-berube/flat-animal/duck.ico" alt="Click Button to click picture" style="width:300px;height:300px" >
<p>
<button type="button" onclick="display(1)">Click!</button>
<button type="button" onclick="display(0)">Reset</button>
</p>
</body>
</html>
You forgot the protocol (file://). It should be like
document.getElementById('Click').src="file://C:\Users...";
otherwise it will be just appended to the src everytime you click a button.
Try to put your JavaScript in the <head> section. Then it might work.
Also. There is no such thing as image in HTML. It's img.
In javascript, you need to escape backslashes in strings, so in adresses in particular. Replace all "\" by "\\".
You shouldn't load images from your disk. We and others can't see it. If you use relative paths and you make sure every images and the HTML file is in the same directory, that should be fine. Even if you do, you must specify the file:// protocol. But if you use external images from a website, we could see them.
There is no <image> element in HTML. It's just <img>.
You should type \\ instead of \, because the \ character has a special meaning. However, Javascript is smart, and you can use / too, don't have to follow Windows' method.
Please don't use the onclick attribute. It's really old. Instead use event listeners.
Right now I don't know what is the problem in your code extacly, however, there is a working example:
<!DOCTYPE html>
<html>
<title>Pic Change</title>
<script>
document.addEventListener("DOMContentLoaded", function() {
document.querySelector("button").addEventListener("click", function() {
document.querySelector("img").setAttribute("src", "file://C:/Data/300x300-colored.png");
});
});
</script>
<p><img src="file://C:/Data/300x300.png" /></p>
<p><button type="button">Click!</button></p>
</html>
If both images and the index.html is in the C:\Data directory, it works fine.
I have an HTML page which auto refreshes itself every 5 sec. This page contains 3 image from 3 different server which i want to show side by side and and refresh every 5 second.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>HMI Remote Monitoring</title>
<meta http-equiv="refresh" content="5" >
</head>
<body>
<table>
<tr>
<td>Chamber 1:100.206.214.19</td>
<td>Chamber 2:100.206.214.122</td>
<td>Chamber 3:100.206.214.145</td>
</tr>
<tr>
<td>
<img border="2" src="http://100.206.214.19/remote/display.bmp" alt="" name="displayImage" width="400" height="240">
</td>
<td>
<img border="2" src="http://100.206.214.122/remote/display.bmp" alt="" name="displayImage" width="400" height="240">
</td>
<td>
<img border="2" src="http://100.206.214.145/remote/display.bmp" alt="" name="displayImage" width="400" height="240">
</td>
</tr>
</table>
</body>
<html>
I am using the http-equiv to refresh the html and it works fine when it's an HTML page in Collaboration view. but now I need to move this same html into a Text area visualization and the refresh doesn't work there.(Mainly coz collaboration dont accept static HTML and i'll have to keep a server running somewhere to keep the html alive.Doable but not a nice solution.)
I know a few alternatives such as using iron-python to reload the html content of the text area(Feels like a overkill + making it sleep in a loop will freeze the viz - will be an unnecessary challenge) or just use the images as labels(it has it's own challenges and is subject of another question I have raised already.) But I was wondering if there's a way we could use JavaScript(clearly I'm bad with JS, so couldn't crack it.) to reload the text area content?
Thanks for your solutions and ideas.
try page refresh using meta tag and content with time you can check in below url
Auto refresh code in HTML using meta tags
Have you tried this?
setInterval(refreshWidth,500) //trigger every .5 sec
from here
I'm trying to make my website check the screen resolution and replace installed font icons (using #webfont) with plain text links, so that the site is more mobile friendly. Im using Opera Mobile Emulator to check if it works. the user interface I am using clearly comes back with a res of 480x320 (in the very top left of the page), yet the .innerHTML javascript isn't firing off. Any help?
<!DOCTYPE html>
<html>
<head>
<title>Harry's Bar</title>
<meta name="keywords" content="Harry's, bar, st. petersburg, florida, kenneth city, drink specials" />
<meta name="description" content="Harry's Bar in St. Petersburg, Florida. Drink specials every night!" />
<meta name="author" content="Internet Solutions of Florida" />
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<script type="text/javascript">
var width=screen.width;
var height=screen.height;
document.write(width+'x'+height);
if (width<700)
{document.getElementById("homelink").innerHTML="Home";}
</script>
<div class="frame">
<div class="header">
<img class="logo" src="img/logo.png" alt="Harry's Bar" />
<div class="menu">
<ul>
<li><a id="homelink" href="index.html" title="home"></a></li>
<li><a id="drinklink" href="drinks.html" title="drink menu"></a></li>
<li><a id="piclink" href="images.html" title="picture gallery"></a></li>
<li><a id="directionslink" href="directions.html" title="directions"></a></li>
<li><a id="contactlink" href="contact.html" title="contact us"></a></li>
</ul>
</div>
</div>
That javascript is executing before the HTML is being loaded. So there is no element with the id of "homelink" when the javascript fires.
Additionally, by using document.write, you're effectively overwriting your original HTML, so the tag will never load anyway.
Get rid of the document.write call and place the script just before your closing body tag and it should work as intended.
document.write() is not needed. If you want to diagnose you may use document.title or create a div and divid.innerHTML
Make sure your testing on a <700 area
Add a DOM ready fire.
Place this at the end of the
Things should work then :)
I am devloping a phonegap app, I used a multi page template like page1.html, page2.html. Each page hits the server and renders the output and show it in a listview. So the problem is if I hit to redirect from one page to another page means it shows white screen.
And also I tried lot of possible ways when I did the google search. But it not helps for me.
My code is given below:
$('#content').append('<div class="wholediv"><span class = "wholediv_content"><a style="text-decoration:none!important;"href="'+v.pagename+'.html?id='+v.nodeId +'&catname='+ v.pagecat +'" data-ajax="false">'+'<img src="http://www.examole.com/'+image+' " class="eventsimages" alt = "image"/>'+'<br /><p>'+v.pagename+'</p></a></span></div>');
index.html:
<div data-role="page">
<div data-theme="a" data-role="header" data-position="fixed" data-tap-toggle = "false" style="height:45px;">
<h3 id = "title">
Moble
</h3>
<span class="off new_off" id = "off" >Off</span>
</div>
<div data-role="content" id="content">
</div><!-- /content -->
</div><!-- /page -->
</body>
I need to avoid the flickering. Please I did lot of search and applied all those answers it did not help me. If I use data-transition means I need to remove data-ajax="false". What to do?
Double flickering or Double flashing is a well known issue.
The solution posted by Rob is actually what works.
Setting in your mail css file:
.ui-page {
-webkit-backface-visibility: hidden;
}
Use this in your viewport tag aswell:
user-scalable=no
I made a basic template for phonegap. With Jquery mobile and so forth.
http://www.codemonkey.mobi/guides/base.zip
I dont see any whitescreens with my base.
Let us know if this worked for you.
Also try this:
http://blog.hackedexistence.com/phonegap-jquery-mobile-white-screen-flicker-solved
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />