Jump to content

smiles

Members
  • Posts

    774
  • Joined

  • Last visited

Everything posted by smiles

  1. http://www.adobe.com/devnet/adobe-media-server/articles/beginner_live_fms3.html
  2. Sorry, I forgot '.value' -> document.getElementById('search_address').value <!DOCTYPE html><html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map_canvas { height: 100% } </style> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var map; var geocoder = new google.maps.Geocoder(); function initialize() { var latlng = new google.maps.LatLng(37.77, -122.4); // set up the default options var myOptions = { zoom: 8, center: latlng, navigationControl: true, navigationControlOptions: {style: google.maps.NavigationControlStyle.DEFAULT, position: google.maps.ControlPosition.TOP_LEFT }, mapTypeControl: true, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DEFAULT, position: google.maps.ControlPosition.TOP_RIGHT }, scaleControl: true, scaleControlOptions: { position: google.maps.ControlPosition.BOTTOM_LEFT }, mapTypeId: google.maps.MapTypeId.ROADMAP, draggable: true, disableDoubleClickZoom: false, keyboardShortcuts: true }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); if (true) { var trafficLayer = new google.maps.TrafficLayer(); trafficLayer.setMap(map); } if (true) { var bikeLayer = new google.maps.BicyclingLayer(); bikeLayer.setMap(map); } if (true) { addMarker(map,37.7715,-122.4,"We are here"); } } function search() { var searchText = document.getElementById('search_address').value; if (searchText != '') { geocoder.geocode({ address: searchText }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { var viewport = results[0].geometry.viewport; var location = results[0].geometry.location; if (viewport) { map.fitBounds(viewport); } else { map.setCenter(location); } } }); }} function addMarker(map,lat,long,titleText) { var markerLatlng = new google.maps.LatLng(lat,long); var marker = new google.maps.Marker({ position: markerLatlng, map: map, title:"We are here", icon: "" });} </script> </head> <body onload="initialize()"> <div id="map_canvas" style="width:100%; height:100%"></div><input type="text" id="search_address" value="" size="98"/><button onclick="search();">Search</button> </body></html>
  3. lets map be a public variableyour search function maybe like this function search() {var searchText = document.getElementById('search_address');if (searchText != '') { geocoder.geocode({ address: searchText }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { var viewport = results[0].geometry.viewport; var location = results[0].geometry.location; if (viewport) { map.fitBounds(viewport); } else { map.setCenter(location); } } });}}
  4. For simple, the files and folders hierarchy will be like below - test.html- jquery-ui-1.8.20.custom.css- jquery-ui-1.8.20.custom.min.js- jquery-1.7.2.min.js- images- - - - ui-icons_cd0a0a_256x240.png- - - - ...- - - - ... and in your test.html <link type="text/css" rel="stylesheet" href="jquery-ui-1.8.20.custom.css" /><script src="jquery-1.7.2.min.js"></script><script type="text/javascript" src="jquery-ui-1.8.20.custom.min.js"></script> That's all! You dont have to worried about which jQuery ui should be imported.
  5. Try this timeout = setTimeout(function(){ sayGreet("Hello", "There!");}, 5000);
  6. Here has a lot of choices http://www.htmldrive.net/categorys/show/1/Menu-Navigation
  7. Put id for two selects<select id="users" name="users" ..><select id="age" name="age" ...> Just onchange=showUser()function showUser(){ var age = document.getElementById("age").value; var user = document.getElementById("users").value; ...}
  8. Follow Quicksand's homepage http://razorjack.net/quicksand/, I see one difference - Your div that contains <ul id='content' ...> also contains filterOptions, while in Quicksand's homepage, filterOptions place outside that div - That div also has its width nearly two times larger than <ul id='content' ...> (I think object will based on width of object's container to calculate the offset for animation)
  9. http://www.html5rock...ile/filesystem/ Chrome File API stores files as blob, for e.g you create abc.txt then the link to access maybe like this C:\Users\{your account}\AppData\Local\Google\Chrome\User Data\Default\File System\001\t\00\00000002 Here is the code I tested before <script>var fs = null;// Check for the various File API support.if (window.File && window.FileReader && window.FileList && window.Blob) { // Initiate filesystem on page load. initFS();} else { alert('The File APIs are not fully supported in this browser.');}function errorHandler(e) { var msg = ''; switch (e.code) { case FileError.QUOTA_EXCEEDED_ERR: msg = 'QUOTA_EXCEEDED_ERR'; break; case FileError.NOT_FOUND_ERR: msg = 'NOT_FOUND_ERR'; break; case FileError.SECURITY_ERR: msg = 'SECURITY_ERR'; break; case FileError.INVALID_MODIFICATION_ERR: msg = 'INVALID_MODIFICATION_ERR'; break; case FileError.INVALID_STATE_ERR: msg = 'INVALID_STATE_ERR'; break; default: msg = 'Unknown Error'; break; }; console.log('Error: ' + msg);} function initFS() { window.webkitRequestFileSystem(window.TEMPORARY, 1024*1024, function(filesystem) { fs = filesystem; }, errorHandler);} function writeFile(path, content){ fs.root.getFile('log1.txt', {create: true}, function(fileEntry) { fileEntry.createWriter(function(fileWriter) { fileWriter.onwriteend = function(e) { console.log('Write completed.'); }; fileWriter.onerror = function(e) { console.log('Write failed: ' + e.toString()); }; var bb = new window.WebKitBlobBuilder(); bb.append(content); fileWriter.write(bb.getBlob('text/plain')); }, errorHandler); fs.root.getDirectory(path, {create: true}, function(dirEntry) { fileEntry.moveTo(dirEntry); console.log('in'); }, errorHandler); }, errorHandler);} </script><button onclick="writeFile('file-api/', 'blah blah blah')">Test FileAPI</button>
  10. Hi! You should get familiar with AJAX, it is so popular http://w3schools.com...ax_examples.aspAfter understand somehow about it, I recommend jQuery.ajax http://www.w3schools...jquery_ajax.asp
  11. just surround element.fireEvent(event.eventType, event); by try catch try { element.fireEvent(event.eventType, event);} catch (error) { // error here maybe fireEvent not allow the second argument. element.fireEvent(event.eventType);}
  12. Well!!! SCRIPT438: Object doesn't support property or method 'fireEvent' prototype.js, line 5736 character 7 You may check this link http://prasadblog.blogspot.com/2009/11/prototype-eventfire-exception-to-be.html
  13. Because the #slider's width always be set with the same size as original width of the big images, so I think u have to design your images with the fix width (see below, 390px) temporarily, in .css div.mc-caption-bg, div.mc-caption-bg2 -> add width: 390px; #slider -> add width: 390px; (also, overflow: hidden)
  14. smiles

    Full height of a page

    Something like this ? <html><head><style type='text/css'> html, body {height: 100%; margin: 0} #content {width: 100%; height: 100%;} #top {position: absolute; top: 0px; bottom: 115px; width: 100%; background-color: pink;} #bottom {position: absolute; bottom: 15px; height: 100px; width: 100%; background-color: green;}</style></head><body><div id='content'> <div id='top'>blah</div> <div id='bottom'>blah</div></div></body></html>
  15. Nope!!! I see it again, smooth now, .js in minimized version so can't be edited, your config code for slider is the same as example, your css just to put the elements in the right place, no effect on smoothness. I see no problem now, sorry to confused you
  16. I try your code, see the same thing, I think there is no problem with removeChild or appendChild, please notice 'viewers' variable in viewer.js, after each 500ms, it will contain one more Viewer object, I see Chrome process in Task Manager raise its using memory -> hanging. Try to put viewers = [] in front of viewers.push(this) at line 38, everything will be fine!
  17. The only difference between yours and example that affect smoothness is the Description part, it changes while gallery's images slidingTry to find out the animation function and put in another function that run when animation ends $('...').animate({[some css attributes]}, [duration], function(){ //animate stop here, then changes Description here})
  18. Try this <html><head><style type='text/css'> html, body {height: 100%; margin: 0} #content {width: 100%; height: 100%} #left {width: 100px; height: 100%; float: left; background-color: red} #right {margin-left: 100px; height: 100%; background-color: green}</style></head><body><div id='content'> <div id='left'>Testing</div> <div id='right'>Testing</div></div></body></html>
  19. smiles

    Twitter.

    $(function(){...}) will run after all DOMs loaded, while window.onload does the same but include images, objects ... loaded.So why put window.onload inside $(function(){...}), just comment it out. Try declare barLocations outside $(function(){...}), use var barLocations = []; then in success function: barLocations = []; (reset it)barLocations.push($.parseJSON(output)); I think your alert will be OK!
  20. Hello! Menu của bạn bỏ trong một cái iframe, tức là vốn thuộc về một trang khác, nên hiệu ứng nổi chỉ có tác dụng với trang đó (http://911radio.freevnn.com/iframe.html) :)

  21. Thanks !!! 1 year = 0.92M, I have 9 years ahead
  22. No, I mean my old site hosted by awardspace, http://myloves124.awardspace.com/main_forum.php (byethost is good but don't know why I feel about it as an unstable thing) Anyone help me with above question
  23. well the host provider is recovered after attacking and I can enter my old site, I think the problem is it lost DNS system, so don't know where to point to my site one more question, I enter my database manager, it says Space Quota: 10MUsed Space: 0.96MDoes it mean the capacity of my database (.sql file) only reach 10M ?Thanks !!!
  24. Thanks, at the moment, I move all to new host http://myloves124.byethost3.com (this host loads faster than awardspace and result is it forgets some files )And one wonder, if for some reasons, I can't access link above from my place, byethost also gives me another domain named http://myloves124.co.cc, can I access it ?
×
×
  • Create New...