Jump to content

astralaaron

Members
  • Posts

    1,254
  • Joined

  • Last visited

Posts posted by astralaaron

  1. In my CSS file, my div has a min-height of 600px. The problem I am having is that one of my javascripts needs to know the height of this div, and sometimes, depending on the content, the div will expand beyond 600px. When I try to get the height with javascript, it still says 600px even if it has expanded. Any advice is appreciated!

  2. Do you have any idea why the following will not work? It always results in 16:00 ($_POST is coming from my form which outputs an AM / PM time)

    // $_POST['time']   =  "02:32PM";$hour24time = date("H:i", strtotime($_POST['time']));

    While this works fine? Results in 14:32

    $hour24time = date("H:i", strtotime("02:32PM"));
  3. Why would getElementsByTagName('a') be returning the href tag instread of giving me access to the anchor elements?

    function get_links(elm) {var container = document.getElementById(elm);var links = container.getElementsByTagName('a');console.log(links[0]);}

    I can't make any sense of this

  4. Having two database fields for deleting is the first thing that comes to my mind, but I think there might be better ways to do it. If a PM had multiple recipients this solution wouldn't work.

     

     

     

     

    I'm glad you pointed that out, i went with setting up a separate lookup table. Thanks guys.
  5. I am trying to figure out a way that makes sense to handle the trash bin of a private messaging system in my project.

     

    When a message is sent from user_a, an entry to the 'msg_thread' table is made with the sender_id, receiver_id, subject, message, etc. I have a boolean 'trash' field for if the message is marked as trash..but if one user marks trash then it will go to the trash for both users.

     

    So I am wondering, would it make sense to have sender_trash and receiver_trash instead of just 'trash'?

     

    How would you handle emptying the trash bin? do you need another field for 'sender_emptied_trash' and 'receiver_emptied_trash' to know when to delete the database record?

     

    Any advice?

  6. Using the hash for a source isn't a great practice, but I don't see a reason why that function would trigger navigation.

    If you don't need a src for the iframe and are just using the iframe for an image upload, would you just not write an SRC at all? Now I am not putting an SRC tag at all and its working fine.

     

    I was reading around and found discussion about iframes causing random elements to scroll when they have fragmented URL's ( http://stackoverflow.com/questions/26017978/iframe-causes-parent-elements-to-scroll-up-on-google-chrome-when-url-contains-fr )

  7. I found the problem, wow it is strange.

     

    I have an iframe on the page that I am using in my "ajax" image upload.. In my iframe src="" tag i had a "#". (src="#") removing the src fixes the problem..if I add the src="#" the page scrolls all the way down when the page loads, and then every time the setTimeout() is called.

     

    Really strange, anyway no more problems..but does anyone know why that was happening?

  8. I am using a javascript to display a clock on a website I am working on. I just noticed that if i load the page on Chrome, every time the clock updates, the page scrolls all the way down...the weird thing is that it is only doing it on one specific page, the script works fine on other pages.

     

    This is the script for the clock:

    function updateClock ( ){	var months = new Array('January','February','March','April','May','June','July','August','October','November','December');	var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');	function endings( date ) {		var end = '';		switch(date) {			case 1:case 21:end = 'st';break;			case 2:case 22:end = 'nd';break;			case 3:case 23:end = 'rd';break;			default:end = 'th';break;		}		return end;	}  var currentTime = new Date ( );  var currentHours = currentTime.getHours ( );  var currentMinutes = currentTime.getMinutes ( );  var currentSeconds = currentTime.getSeconds ( );  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;  var ampm = ( currentHours < 12 ) ? "AM" : "PM";  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;  currentHours = ( currentHours == 0 ) ? 12 : currentHours;  var currentTimeString =  "<span>" + currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + ampm + "</span> on " + days[currentTime.getDay()] + " " + currentTime.getDate() + endings() + " " + months[currentTime.getMonth()] + " " + currentTime.getFullYear();  document.getElementById("clock").innerHTML = currentTimeString;  window.setTimeout(function(){updateClock();},'1000');}

    I was up all night last night trying to fix it, I'm getting no where. it is definitely happening every time the setTimeout fires.. At first I had the setTimeout written like this: window.setTimeout(updateClock,'1000'); both ways the same thing happens.

     

    Has anyone ever had an issue like this? Anyone have any tips to pin point what is causing the problem?

     

    EDIT:

    I am pretty sure the only difference on this page is that I use a jquery plugin to crop images (jcrop) I tried including the files on the other pages to see if the same problem would happen, but it doesn't happen.

  9. Searches are mostly about focus and the amount of data that has to be sifted. Target only the data that has the info you need in tables that don't contain a bunch of irrelevant data or data that requires a lot of calculation and your queries will usually be as fast as you can make them

     

    Sorry, I have a difficult time wrapping my head around things some times.. When you say "tables that don't contain a bunch of irrelevant data" that means that the table with only the two fields would be faster than targeting the table that has 10 fields? The 8 additional fields are irrelevant to this specific search..

     

     

    Thank you for responding.

  10. If there is a table that has 10 fields, and you wanted to select only 2 of the fields, is it slower than if the table only had 2 fields and using a select *?

     

    I am wondering if I should have my members table have more fields or to create a separate table for their account profile information

  11. filter:progid:DXImageTransform.Microsoft.DropShadow(enabled=true, offX=1, offY=1, color=#00ff00);

    anyone know why this doesn't work in IE7 - 8? (with or without the enabled parameter..)

  12. Here is the area of the code with an issue... " x.oldMarquee.style.textShadow = '3px 3px 1px #0000ff'; " is not working

    	x.oldMarquee = document.createElement('marquee');		e.canvasId = settings.parent + '_marquee';		//IE7	x.oldMarquee.trueSpeed = 'truespeed';	x.oldMarquee.scrollAmount = ((settings.velocity) ? settings.velocity : 1);	x.oldMarquee.scrollDelay = '18';	// > IE7	x.oldMarquee.setAttribute("truespeed","truespeed");	x.oldMarquee.setAttribute("scrollamount", ((settings.velocity) ? settings.velocity : 1));	x.oldMarquee.setAttribute("scrolldelay","18");	x.oldMarquee.style.position = "relative";	x.oldMarquee.stylx.overflow = "hidden";	var weight, style, family, color, size, hover;	x.oldMarquee.style.paddingTop = ((settings.height - ((settings.fontSize) ? (settings.fontSize) : 14)) / 2) + "px";	x.oldMarquee.style.size = size = (settings.fontSize) ? (settings.fontSize + "px") : '14px';	x.oldMarquee.style.fontWeight = weight = (settings.fontWeight) ? settings.fontWeight : 'normal';	x.oldMarquee.style.fontStyle = style = (settings.fontStyle) ? settings.fontStyle : 'normal';	x.oldMarquee.style.fontFamily = family = (settings.fontFamily) ? settings.fontFamily : 'Times New Roman';	x.oldMarquee.style.color = color = (settings.fontColor) ? settings.fontColor : '#000';	x.oldMarquee.style.textShadow = '3px 3px 1px #0000ff';	x.oldMarquee.id     = x.canvasId;	x.oldMarquee.width  = settings.width;	x.oldMarquee.height = settings.height;	x.parentNode.appendChild(x.oldMarquee);
  13. This is related to my other post about the numbers showing up as NaN with developer tools open.

     

    I really need to know if the script works in IE 9 / 10, all I have is 11.

     

    I am not sure if it is not working in ie10 / 9 or if it is just because the developer tools document mode is on.

     

    Is it safe to assume if it is working in IE11, that it is working in IE10 and 9? How would you go about testing it? I read that the best way is to test it on a legitimate copy of those versions..but how do you do that? Can you install different versions? This is sort of urgent, appreciate any advice.

×
×
  • Create New...