Search the Community
Showing results for tags 'jquery'.
-
<html> <div id="loading"></div> <div id="realbody"> //my real body here </div> </html> <style type="text/css"> #loading { background: url('my-loading-gif.gif') no-repeat center center; position: absolute; top: 0; left: 0; height: 100%; width: 100%; z-index: 9999999; }</style> <script> function hideLoader() { $('#loading').hide(); } $(window).ready(hideLoader); // Strongly recommended: Hide loader after 20 seconds, even if the page hasn't finished loading setTimeout(hideLoader, 20 * 1000); </script> I wanted to have a gif that is presented when my website is loading and I found this code online. But when I tried it, it played over the real body and didn't leave when my page had finished loaded.
-
I am currently working on a website that is a mixture of php, AJS, and JQuery. I was wondering if AJS or JQuery would work on other free hosting websites or if i should just wait for my javascript to be active on this site. I mean I'm in no hurry, but why wait until may if i can do it now. Right? This is probably a stupid question but I figured I'd ask.
-
Hi it me again sorry to ask but I have a huge Problem and need help very fast… I am building a Website for a friend whit both a “mobile” and a “normal” version. I am new to programing any language. So I have almost no experience whit it... I know you normally you would use a CMS like drupal etc. but I don’t like them so… So I knew of the Ajax method using JavaScript so I wanted to use that method to build a simple CMS to swap the content whit “articles” in a folder on the server. So loading a single site is no problem… jQuery - AJAX load() Method or Load page to a div jQuery Mobile So back in the internet I found this method: It changes the div content and adds a #page name to the URL: How to load content with back button enable and refresh using Ajax the script: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.js"></script> <script type="text/javascript"> $(function(){ // part 1 $('menu a').click(function(){ location.hash=$(this).attr('href').match(/(^.*)\./)[1] return false }) // part 2 var originalTitle=document.title function hashChange(){ var page=location.hash.slice(1) if (page!=""){ $('#content').load(page+".html #sub-content") document.title=originalTitle+' – '+page } } // part 3 if ("onhashchange" in window){ // cool browser $(window).on('hashchange',hashChange).trigger('hashchange') }else{ // lame browser var lastHash='' setInterval(function(){ if (lastHash!=location.hash) hashChange() lastHash=location.hash },100) } }) </script> <title>main</title> </head> <body> <menu> <li><a class="menu_links" href="newproject.html">New Project</a></li> <li><a class="menu_links" href="accord.html">Accordion</a></li> <li><a class="menu_links" href="project_summary.html">Summary Table</a></li> <li><a class="menu_links" href="detail_report.html">Detail Report</a></li> <li><a class="menu_links" href="upload_data.html">Upload Data</a></li> </menu> <div id="content"></div> </body> </html> And in the demo (link) it works well. But for some reason I’m not getting it to work whit my own Site… Could someone please help me by explaining how I have to set all the <div> so that I can build the rest of my site? I know I am asking allot… But please help me… And thanks for reading this Question and answering my questions p.s. sorry for my bad English.