Jump to content

toxicious

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by toxicious

  1. function instaSearch(acount, searchTerm){//Abort opened requests to speed it upif(runningRequest){ request.abort();}else{ //Show searchtip $('#searchText').slideDown("200");}runningRequest=true;request = $.get('addonstable.php',{ search: encodeURIComponent(searchTerm) , count: acount},function(data){ $("#table").html(data); //Remove searchtip $('#searchText').stop(true); $('#searchText').slideUp("200"); runningRequest=false;});} As you can see, no big changes. I am using an anonymous function with no name. Are you sure it needs to be named success?
  2. Yeah, realised now that I need to put the "remove code" for the searchtip there. But since I am providing that callback function, why does it still lag? Is there something else causing it maybe?
  3. I'm trying to implement insta-search on my webpage, and I have got it working.But there is one problem: it doesn't seem to be completely async. Here is the page with the search box: http://gaddons.tk Oh, and don't visit it in IE since it doesn't work at all in IE (the whole div turns white lol, have to make another thread about that).If you type something quite fast the site will either hang or some of the letters you typed won't get typed, the syndroms of sync requests. I am searching "onkeyup" using this javascript method: function instaSearch(acount, searchTerm){//Abort opened requests to speed it upif(runningRequest){ request.abort();} //Add searchtip - this doesn't seem to get added either, though if I add alerts before and after I can see it....$('#searchBox').after('<p id="searchText">Searching...</p>');runningRequest=true;request = $.get('addonstable.php',{ search: encodeURIComponent(searchTerm) , count: acount},function(data){ $("#table").html(data); runningRequest=false;});//Remove searchtip$('#searchText').remove();} Any clue on how I can make it completely async?I know at least two pages that has a completely async search, Google and the Swedish site "prisjakt.nu", so it can't be a impossibility
  4. Thanks for the tip, but I tested it in IE, Chrome and Firefox, so nope, not because of that.
  5. Nope no writing errors. I was able to get it working again by doing my resize via jQuery, $('#leftCol').css('width', sideWidth);So I'll stick to that instead. But still weird that the original thingy doesn't work...
  6. Everything worked perfectly everywhere, except for in IE. I found out that I needed a DOCTYPE declaration at top to make the page show correctly in IE. So I added this one: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Now the page looks as it should in all browsers, except for one thing, that line of code broke my javascript resize of some divs at page load?!I have hooked the jquery window.load function to resize 2 divs at the page, but it doesn't work anymore. If I remove the DOCTYPE it works again. So I figured there must be something "invalid" in my resize code, which is this one: function resize(){ var pageWidth = document.body.offsetWidth;var middleWidth = 530;var sideWidth = (pageWidth - middleWidth) / 2;document.getElementById("leftCol").style.width = sideWidth;document.getElementById("rightCol").style.width = sideWidth;} In the error console it says that "document.getElementById("leftCol") is null". Why can't I use getElementById anymore?
  7. There was only one problem: fu typo'sThanks for taking time helping me
  8. Sure, here's the css of the three columns: #leftCol {display: none;width: 36%;height: 100%;left: 0px;top: 0px;position: fixed;background: #F06;}#middleCol {margin: 0px auto;margin-top: -10px;width:600px;padding-bottom: 20px;background: #603;}#rightCol {display: none;width: 36%;height: 100%;position: fixed;top: 0px;right: 0px;background: #30F;} The backgrounds are just there since I am still working on it (to make it clearer). The display: none is because I'm trying to use a fadeIn effect.
  9. I just solved it (before I saw your post).Apparently, the right div didn't understand that the position of it should be FIXED. I changed the height of the middle, then the right appeared. I put some colors on the background and saw that the right started at the same height that the middle ended. Meaning that if I put 100% height on the one in the middle, the right one "disappears". So I solved it by putting top: 0px. Sounds maybe like an obvious move that I should have done from the beginning, but since the left div didn't need it, I didn't think of it. Thanks for your help!
  10. Oh found it now. Nope, not getting any errors/warnings related to my code
  11. good idea, that worked! EXCEPT I now have another problem:Since I am using a 3 column layout (3 divs) and want the two side ones' fixed I'll have to center the middle one on some other way than float:left (since there is no left div that keeps it from the border. I tried with margin: 0px auto; but if I set that and remove float:left, the right div disappears? Why does it disappear when I remove the float:left?
  12. Could you show some example code? For example can I hide it with display:none in the css?Where should I set it to block?
  13. I have my divs set to display:none in the css, but when I try to use the fadeIn function nothing happens.If I use .hide().fadeIn() it works, but I want it to be hidden initially, not blink. I tested in both firefox and chrome. Have I missed something?I tried with both visibility: hidden, opacity 0 and some other methods, but none work.
  14. I have a div that is floating to the right and is 30% width. Within that div I have another div that has this css: #testDiv {position: fixed;top: 150px;bottom: 0px;border-style: solid;border-width: 5px;width: 350px;height: 130px;text-align: center;border-radius: 30px;font-family: Tahoma, Geneva, sans-serif;font-size: 14px;} What I want to do is to center this div within the first div. How can I achieve that? Remember, I want the position:fixed so it "stickies" when you scroll
  15. Firebug stopped working with the latest Aurora, so I'll just wait until they update it before I do any more debugging I think.
  16. Yes, I have an alert on the click event. If I remove the checkboxes code (as I said) that alert goes off.Where should I check for the errors?
  17. This piece of code is driving me nuts: function loadBtn(){var theBtn = document.getElementById("gaddonsBtn"); //Add the checkbox if (element != null) { element.innerHTML += '<br /><input type="checkbox" id="autoPick" value="autoPick" style="margin-top: 8px;" /> Auto-pick best mirror'; } var checkbox = document.getElementById("autoPick"); //Add the save event if (checkbox != null) { document.getElementById("autoPick").addEventListener("click", saveAutoPick, false); } theBtn.addEventListener("click", navigate, false);} The problem is that when I click "theBtn" nothing happens. But if I remove all the checkbox code (all code except the first and last line) the button do work.There is something wrong with that checkbox code. The checkbox gets added, I can view it, and its click event works too. The only thing that doesn't work here is the damn button. It would be great if someone could help me on what's wrong here!
×
×
  • Create New...