Jump to content

Destramic

Members
  • Posts

    960
  • Joined

  • Last visited

Everything posted by Destramic

  1. i managed to get the positoning right although im still having a few css issues if someone could please help if you view here http://139546017.reseller20.grserver.gr/test.html 1. basically when the image is hovered over it goes transparent then the overlay goes over the top of that....but for some reason the overlay is also transparent which i dont want. 2. also i put two divs inside the overlay div called left and right...what im trying to do is make the cropped image icon and the delete icon on the overlay as a active link advise or any help would be great thank you
  2. hey guys im trying to impliment a overlay to images uploaded by the user to allow to delete and crop...now im not sure if im going aroung this the right way (but it works sort of)...the problem im having is that the overlay.gif which is a transparent image which has 2 small images at the top of each corner...but when the original image is hovered over the overlay is out of position showing the 2 small images at the bottom of the div and not at the top where it should be. im guessing it is a css issue...any advise would be greatly appreciated...thank you #overlay { width: 110px; height: 110px; } .selected-image{ width: 110px; height: 110px; } #overlay:hover .selected-image { opacity: 0.4; filter: alpha(opacity=40); } #overlay:hover { background-image: url('overlay.gif'); width: 110px; height: 110px; } <div id="overlay"><img class="selected-image" src="logo.png" /></div>
  3. hey guys im trying to make a file upload script so that when the user uploads a pic it gets shown in a div...when you add another it is the added by the side of the 1st pic...but some reason when selecting a image nothing shows... what am i doing wrong? here is my code below if anyone can tell me what it is wrong im doing...thank you <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script> $( document ).ready(function() { var files = $('.input-file').prop("files"); var file_count = files.length; var names = $.map(files, function(val) { return val.name; }); $('#input-file-button').click(function() { $('.input-file').click(); }); $('.input-file').change(function (){ var file_name = $(this).val(); var file_path = URL.createObjectURL(event.target.files[0]); $('#uploaded-images').append('<div><img src="'+ file_path +'" /></div>' + file_name); }); if (file_count < 1) { $('#uploaded-images').text("No images are selected."); } }); </script> <style> .input-file { display: none; } </style> </head> <body> <div id="uploaded-images"></div> <br /> <input type="file" name="files[]" class="input-file"/><span id='input-file-button'>Upload Photo</span> </body> </html>
  4. well this is embarrassing...yeah it works now for me...well sorry to have wasted your time, but thank you for you posts
  5. i've google but no luck on finding what i need....is there a way in javascript to compare 2 variables ie. var him = "jack"; var her = "jill"; if (him == her){ alert('same name'); } thank you
  6. lovely!, thanks alot for your help guys
  7. well i did a simple test and still did get the variable passed accross...but didnt work...i dunno what im doing wrong <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <?php $timezone_offset = "test"; ?> <script> var time = "test"; </script> <script src="global.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </body> </html> global.js alert(time); var timezone_offset = "<?php echo $timezone_offset; ?>"; alert(timezone_offset);
  8. i think the only way to put a php var in js is if the script is internal and not external
  9. i tested by putting <?php $test="hello"; ?> in my template file above where the script get loaded... when tyring to see if i could get the variable value in the script...no luck just doesnt make sense
  10. but the variables are extracted first before the template is included...so when rendering the template my variable should be accessable to the js file =/
  11. just shows up as var timezone_offset = <?= $timezone_offset ?>; the php variable isnt being executed
  12. well the php variable is in the extental js file which is included in the head...is this what your asking for? <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8" /> <script src="http://127.0.0.1/bisi/media/js/library/jquery/2.1.1/jquery.min.js"></script> <script src="http://127.0.0.1/bisi/media/js/library/jqueryui/1.11.2/jquery-ui.min.js"></script> <script src="http://127.0.0.1/bisi/media/js/scripts/global.js"></script> // here is the line of the file where php var is in <script src="http://127.0.0.1/bisi/media/js/scripts/user_timezone.js"></script> <link rel="stylesheet" type="text/css" href="http://127.0.0.1/bisi/media/css/items/items.css" /> <title>BiSi</title> </head>
  13. when tyring to pass a variable to a extenal javascript file it just shows up as a sting and the variable isnt beening executed var timezone_offset = <?= $timezone_offset ?>; im guessing its probably down to the fact the variable is being passed from my framework controller... so im wondering how do you send a variable to a external javascript file when using a framework? $this->view->timezone_offset = "test"; // in my controller // passing varibales to template in my view if (preg_match("/\.html$/i", $file_name)) { extract($this->_variables); require_once PRIVATE_DIRECTORY . 'application' . DS . 'views' . DS . $file_name; } thanks guys
  14. well i'm trying to be resourceful with my query's so i dont have to basically write the same one up with a bit of change...but that left join worked great thank you thank you
  15. when looking i bumped into this script, which i had to alter a few things function pad(number, length) { var str = "" + number while (str.length < length) { str = '0'+str } return str } var offset = new Date().getTimezoneOffset(); offset = ((offset <0 ? '-' : '+') + pad(parseInt(Math.abs(offset/60)), 2) + ':' + pad(Math.abs(offset%60), 2)); alert(offset); seems to do the trick in return the offset i need....+00:00
  16. ah ok thats good to know it compares to a utc timezone...but when i change the my system time (UTC + 1...) shouldnt that change the offset to something else other than 0 IE. 1? but yes im wanting to then translate the value to +00:00, +01:00 etc.. thank you for the useful information
  17. that worked like a dream...thanks one more thing im using var offset = new Date().getTimezoneOffset(); to get users timezone but when testing on my system its always returning 0...so im guessing i would have to compare it againts a utc timestamp to work out the difference to get the result im looking for?
  18. i've read and seen there are variations of what im trying to achieve but havent seen a exact example...what im trying to do is put a where clause in my query depending on if a set variable has a value CASE WHEN (@category_id IS NOT NULL) THEN LEFT JOIN sub_categories sc ON sc.sub_category_id = i.sub_category_id JOIN categories c ON c.category_id = sc.category_id AND c.category_id = :category_id END is this possible or have i just got the syntax wrong somewhere...thank you guys
  19. when trying to get the date var visitors_time = new Date(); i'll being back a result like Mon Oct 27 2014 20:54:55 GMT+0000 (GMT Standard Time) my issue is, is there a way of getting the end part with the brackets to not show up? ie. format the date?...ive googled but doesnt seem no simple solution like php to actually format the date to the way you'd like it thank you guys
  20. ive checked the control panel and there's no way i can change or add options to it
  21. i have just recently purchase a server but the ttimezone is way off on both php and mysql...i did a bit of reading to create my own php.ini file so i can change timezone but it doesnt seem to change root in phpinfo() php.ini date.timezone = "Europe/London" .htaccess <Files ~ "\.(ini)$"> order allow,deny deny from all </Files> SetEnv php.ini // same location as .htacess so im boggled to why my custom php.ini isnt being read also is there a way to customise a my.cnf file from my .htaccess to change settings? thank you
  22. this did the trick CONVERT_TZ(now(), '+00:00', '+05:00')
  23. ok great thanks...would that work the same if users timezone is -1? due to getting the user timezone via javascript it will return results as +1, -1 or 0 etc... although i could return the results as 00:00, -01:00, +01:00 etc.... thank you again
  24. hey guys im wondering how you would add or takeaway a hour from a timestamp in a database when trying to select it please? thank you
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.