Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Everything posted by techker

  1. thx for the reply, wasn't waiting for code just advise.. i updated to the latest jquery. but also noticed the bootstrap.carousel.js on the site says Transition animations not supported in Internet Explorer 8 & 9Bootstrap exclusively uses CSS3 for its animations, but Internet Explorer 8 & 9 don't support the necessary CSS properties. Thus, there are no slide transition animations when using these browsers. We have intentionally decided not to include jQuery-based fallbacks for the transitions. so i guess i will change my code...lol what would be more compatible?Ajax?
  2. oh sorry.. so jquery is not fully compatible with IE?is there a way to convert this?
  3. Hey guys im still having this nerver ending struggle between IE .Chrome,Firefox.......Compatibility... so i have this carrousel on my set and it works great in all browsers but IE.... is there a way to make it work correctly?it goes right but doesnt come back to first page... js !function ($) { "use strict"; // jshint ;_; /* CAROUSEL CLASS DEFINITION * ========================= */ var Carousel = function (element, options) { this.$element = $(element) this.options = options this.options.slide && this.slide(this.options.slide) this.options.pause == 'hover' && this.$element .on('mouseenter', $.proxy(this.pause, this)) .on('mouseleave', $.proxy(this.cycle, this)) } Carousel.prototype = { cycle: function (e) { if (!e) this.paused = false this.options.interval && !this.paused && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) return this } , to: function (pos) { var $active = this.$element.find('.active') , children = $active.parent().children() , activePos = children.index($active) , that = this if (pos > (children.length - 1) || pos < 0) return if (this.sliding) { return this.$element.one('slid', function () { that.to(pos) }) } if (activePos == pos) { return this.pause().cycle() } return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) } , pause: function (e) { if (!e) this.paused = true clearInterval(this.interval) this.interval = null return this } , next: function () { if (this.sliding) return return this.slide('next') } , prev: function () { if (this.sliding) return return this.slide('prev') } , slide: function (type, next) { var $active = this.$element.find('.active') , $next = next || $active[type]() , isCycling = this.interval , direction = type == 'next' ? 'left' : 'right' , fallback = type == 'next' ? 'first' : 'last' , that = this , e = $.Event('slide') this.sliding = true isCycling && this.pause() $next = $next.length ? $next : this.$element.find('.item')[fallback]() if ($next.hasClass('active')) return if ($.support.transition && this.$element.hasClass('slide')) { this.$element.trigger(e) if (e.isDefaultPrevented()) return $next.addClass(type) $next[0].offsetWidth // force reflow $active.addClass(direction) $next.addClass(direction) this.$element.one($.support.transition.end, function () { $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false setTimeout(function () { that.$element.trigger('slid') }, 0) }) } else { this.$element.trigger(e) if (e.isDefaultPrevented()) return $active.removeClass('active') $next.addClass('active') this.sliding = false this.$element.trigger('slid') } isCycling && this.cycle() return this } } /* CAROUSEL PLUGIN DEFINITION * ========================== */ $.fn.carousel = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('carousel') , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) if (!data) $this.data('carousel', (data = new Carousel(this, options))) if (typeof option == 'number') data.to(option) else if (typeof option == 'string' || (option = options.slide)) data[option]() else if (options.interval) data.cycle() }) } $.fn.carousel.defaults = { interval: 5000 , pause: 'hover' } $.fn.carousel.Constructor = Carousel /* CAROUSEL DATA-API * ================= */ $(function () { $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) { var $this = $(this), href , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data()) $target.carousel(options) e.preventDefault() }) }) }(window.jQuery); DIV <div id="myCarousel" class="carousel slide"> <div class="carousel-inner"> <div class="item"> <div class="row box center"> <div class="span4 marg5"> <p><img src="LOGO/Autostart_Logo.gif"></p> <p></p> </div> <div class="span4 marg5"> <p><img src="LOGO/compustar-pro.jpg"></p> <p></p> </div> <div class="span4 marg5"> <p><img src="LOGO/dse_logo.png"></p> <p></p> </div> </div> </div> <div class="item"> <div class="row box center"> <div class="span4 marg5"> <p><img src="LOGO/fortin.jpg"> </p> <p></p> </div> <div class="span4 marg5"> <p><img src="LOGO/Idatalink.jpg"></p> <p></p> </div> <div class="span4 marg5"> <p><img src="LOGO/drone-logo_white-2.jpg"></p> <p></p> </div> </div> </div> <div class="item active"> <div class="row box center"> <div class="span4 marg5"> <p><img src="LOGO/AccessLogo.jpg"></p> <p></p> </div> <div class="span4 marg5"> <p><img src="LOGO/AVS322065onvehicleHR.jpg"></p> <p></p> </div> <div class="span4 marg5"> <p><img src="LOGO/truck_acc_aries_sidestep_blk.gif"></p> <p></p> </div> </div> </div> <div class="item"> <div class="row box center"> <div class="span4 marg5"> <p><img src="LOGO/class-4-5-hitch.jpg"></p> <p></p> </div> <div class="span4 marg5"> <p><img src="LOGO/BANBO HID XENON KIT NEPTUNE-S.jpg"></p> <p></p> </div> <div class="span4 marg5"> <p><img src="LOGO/IMG4DB82B8BA0689_500.jpg"></p> <p></p> </div> </div> </div> <div class="item"> <div class="row box center"> <div class="span4 marg5"> <p><img src="LOGO/Clarion_Logo.png"></p> <p></p> </div> <div class="span4 marg5"> <p><img src="LOGO/logo-KENWOOD-best.jpg"></p> <p></p> </div> <div class="span4 marg5"> <p><img src="LOGO/parrotlogo.jpg"></p> <p></p> </div> </div> CSS .carousel { position: relative; margin-bottom: 5px; line-height: 1; } .carousel-inner { position: relative; width: 100%; overflow: hidden; } .carousel .item { position: relative; display: none; -webkit-transition: 0.6s ease-in-out left; -moz-transition: 0.6s ease-in-out left; -ms-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel .item > img { display: block; line-height: 1; } .carousel .active, .carousel .next, .carousel .prev { display: block; } .carousel .active { left: 0; } .carousel .next, .carousel .prev { position: absolute; top: 0; width: 100%; } .carousel .next { left: 100%; } .carousel .prev { left: -100%; } .carousel .next.left, .carousel .prev.right { left: 0; } .carousel .active.left { left: -100%; } .carousel .active.right { left: 100%; } .carousel-control { position: absolute; top: 40%; left: 15px; width: 40px; height: 40px; margin-top: -20px; font-size: 30px; font-weight: 100; line-height: 30px; color: #ffffff; text-align: center; background: #222222; border: 3px solid #ffffff; -webkit-border-radius: 23px; -moz-border-radius: 23px; border-radius: 23px; opacity: 0.5; filter: alpha(opacity=50); } .carousel-control.right { right: -25px; left: auto; } .carousel-control.left { left: -25px; right: auto; } .carousel-control:hover { color: #ffffff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); } .carousel-caption { position: absolute; right: 0; bottom: 0; left: 0; padding: 10px 15px 5px; background: #333333; background: rgba(0, 0, 0, 0.75); } .carousel-caption h4, .carousel-caption p { color: #ffffff; }
  4. hey thx. it works but it rounds up all the total.. i just need to remove the last decimals.
  5. So i have an invoice and it calculates tax.works fine but i need to round the decimals.so i don't get 12.1234$ i have this function calculate(){ if(isNaN(document.formname.f1.value) || document.formname.f1.value==""){ var text1 = 0; }else{ var text1 = parseInt(document.formname.f1.value); } if(isNaN(document.formname.f2.value) || document.formname.f2.value==""){ var text2 = 0; }else{ var text2 = parseFloat(document.formname.f2.value); } if(isNaN(document.formname.f3.value) || document.formname.f3.value==""){ var text3 = 0; }else{ var text3 = parseFloat(document.formname.f3.value); } if(isNaN(document.formname.f4.value) || document.formname.f4.value==""){ var text4 = 0; }else{ var text4 = parseFloat(document.formname.f4.value); } if(isNaN(document.formname.f5.value) || document.formname.f5.value==""){ var text5 = 0; }else{ var text5 = parseFloat(document.formname.f5.value); } document.formname.Total.value = (text1+text2+text3+text4+text5)* 0.14975 + (text1+text2+text3+text4+text5);
  6. so i add it here? document.formname.Total.value = (text1+text2+text3+text4+text5)* 0.14975 + (text1+text2+text3+text4+text5); Math.round(document.formname.Total.value)
  7. Hey guys i have tried a few combinations with no luck... i have a tax cal for my invoice form but i need to round out the total not to have 1.23445 i have tried document.formname.Total.value = formname.Total.value.round (text1+text2+text3+text4+text5)* 0.14975 + (text1+text2+text3+text4+text5); document.formname.Total.value = Total.round (text1+text2+text3+text4+text5)* 0.14975 + (text1+text2+text3+text4+text5); ... any clue how?
  8. the JS file is $("#addrow").click(function(){ $(".item-row:last").after('<tr class="item-row"><td class="item-name"><div class="delete-wpr"><textarea name="Item">Item Name</textarea><a class="delete" href="javascript:;" title="Remove row">X</a></div></td><td class="description"><textarea name="Description">Description</textarea></td><td><textarea class="cost">$0</textarea></td><td><textarea class="qty">0</textarea></td><td><span class="price">$0</span></td></tr>'); if ($(".delete").length > 0) $(".delete").show(); bind(); }); is there a way to random the textarea name?like item2 description2....
  9. Hey guys i have an invoice template the fields are basic..price ,business..... but in the invoice section i have a add field button to add more items..(attached pic.) So how can i insert these extra fields in my database?cause it will insert all in one field.. database:Invoice I_ID Business Client_ID Store Item Description total total_tax
  10. great help man..(your up urly to is see..lol) i will test it it.thx im guessing i got to remove my } at the end iof the block. if(isset($_POST['imgmain'])) $Main = $uploaded_images[ $_POST['imgmain'] ]; // now we insert the uploaded thumnail to database $sql = "INSERT INTO new (Main_Image, Image_2, Image_3, Image_4, Image_5) VALUES ('$Main', '$uploaded_images[0]','$uploaded_images[1]','$uploaded_images[2]','$uploaded_images[3]')"; if( ($result = mysql_query($sql)) ) { echo '<p><img src="images/icons/accept.gif" alt"" /> uploaded!</p>'; $page = "index.php?page=portfolio"; $sec = "1"; //header("Refresh: $sec; url=$page"); } else { echo "ERROR: ".mysql_error(); } }} this one
  11. ya the check is to select the picture that is the main image.
  12. i was thinking like this $Main = $_POST["Main"]. " ". $_POST['imgfile']['name']; but i get nothing
  13. the image name is ok its the part to attache the check box to the image i select
  14. ya i noticed.np.. but how can i put it so it can insert the name of the pic?
  15. nice!works great for insert but still the main image ...now it inserts nothing..but i think it is is missing?
  16. i have to upload 4 diffrent image of the same car.out inside side rear... and i need to make one main image for main thumbnail on index page. so thats were im stuck..it uploads it inserts but not like i need it..
  17. but the name of the image in image_2..3...4..5 and i cant seem to get if i check the check box to insert the name of the pic checked..
  18. think you can help me with my uploader??works good uploads all 4 images and reseizes them,. but it insterts wrong in database??? i get :(capture attached..) code $conn = mysql_connect($db_host,$db_username,$db_password); mysql_select_db($databse_name,$conn); $sql="SELECT * FROM new";$result=mysql_query($sql);$data=mysql_fetch_array($result);$gebruiker=$_SESSION['username'];if(!isset($_GET['x'])){ $aantal=4;}else{ $aantal= $_GET['x'];}?><html><head> </head><body><h3> </h3> <fieldset class="dashboard"><legend class="dashboard">Beheer</legend><?phpif (isset($_REQUEST['submit'])) { $name = $_POST["name"]; $description = $_POST["description"]; $Main = $_POST["Main"]; $fieldname = 'imgfile'; $active_keys = array(); foreach($_FILES[$fieldname]['name'] as $key => $filename) { if(!empty($filename)) { $active_keys[] = $key; } } foreach($active_keys as $key) { $path_thumbs = "upload/thumbs"; $path_big = "upload/images"; //the new width of the resized image. $img_thumb_width = 150; // in pixel //Do you want to limit the extensions of files uploaded (yes/no) $extlimit = "no"; //allowed Extensions $limitedext = array(".gif",".jpg",".png",".jpeg",".bmp"); $file_type = $_FILES['imgfile']['type'][$key]; $file_name = $_FILES['imgfile']['name'][$key]; $file_size = $_FILES['imgfile']['size'][$key]; $file_tmp = $_FILES['imgfile']['tmp_name'][$key]; //check file extension $ext = strrchr($file_name,'.'); $ext = strtolower($ext); if (($extlimit == "yes") && (!in_array($ext,$limitedext))) { echo "Verkeerde extensie. <br>--<a href=\"$_SERVER[php_SELF]\">back</a>"; exit(); } //get the file extension. $file_ext = end(explode(".", $file_name)); //create a random file name $rand_name = md5(time()); $rand_name= rand(0,999999999); //get the new width variable. $ThumbWidth = $img_thumb_width; //keep image type if($file_size){ if($file_type == "image/pjpeg" || $file_type == "image/jpeg"){ $new_img = imagecreatefromjpeg($file_tmp); }elseif($file_type == "image/x-png" || $file_type == "image/png"){ $new_img = imagecreatefrompng($file_tmp); }elseif($file_type == "image/gif"){ $new_img = imagecreatefromgif($file_tmp); } //list width and height and keep height ratio. list($width, $height) = getimagesize($file_tmp); $imgratio=$width/$height; if ($imgratio>1){ $newwidth = $ThumbWidth; $newheight = $ThumbWidth/$imgratio; }else{ $newheight = $ThumbWidth; $newwidth = $ThumbWidth*$imgratio; } //function for resize image. if (function_exists(imagecreatetruecolor)){ $resized_img = imagecreatetruecolor($newwidth,$newheight); }else{ die("Error: Please make sure you have GD library ver 2+"); } imagecopyresized($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); //save image ImageJpeg ($resized_img,"$path_thumbs/$rand_name.$file_ext"); ImageDestroy ($resized_img); ImageDestroy ($new_img); move_uploaded_file ($file_tmp, "$path_big/$rand_name.$file_ext"); foreach($active_keys as $key) { mysql_query("INSERT INTO new (Main_Image,Image_2,Image_3,Image_4,Image_5) VALUES ('$Main','$rand_name.$file_ext','$rand_name.$file_ext','$rand_name.$file_ext','$rand_name.$file_ext')"); } } } // $sql = "INSERT INTO new (Main,description,video) VALUES ('$name','$description','$video')"; if( ($result = mysql_query($sql)) ) { echo '<p><img src="images/icons/accept.gif" alt"" /> uploaded!</p>'; $page = "index.php?page=portfolio"; $sec = "1"; //header("Refresh: $sec; url=$page"); } else { echo "ERROR: ".mysql_error(); } } else { ?> <div id="container"> <form action="" enctype="multipart/form-data" method="post" class="niceform" name="UD"><dl> <dd> <?php for($i=0; $i < $aantal; $i++) { ?> </dd> </dl><dl> <dt><label for="imgfile">Kies foto:</label></dt> <dd><input name="imgfile[]" id="imgfile[]" type="file" /> <input type="checkbox" name="Main" id="Main"> <label for="Main"></label></dd> </dl> <?php } ?><dd><input type="submit" name="submit" id="submit" value="Insert" /></dd> </form></div></fieldset> <?php}?>
  19. huh..i didn't know i can put 2 unlink functions in one script..creat..lol thx for the help
  20. ok..i didnt know it downloaded the full image...that answers why the page takes time to load... i didnt like the thumbnail and big size uploader cause to delete the pic it was complicated.. needed to make like 3 scripts to redirect were the thumbnail is and unlink it the refresh to big folder and unlink....
  21. hey guys for my site i have a script that resizes the image for the correct size of the site...but since i put this script the images and site is really slow to load..guessing cause of the resizing.. the reason why i put this is because if i only put width="" height="" in the img it would distort .. is there a way to put width="" height="" but without distorting the image and slowing down the load time?
  22. Reatail_price ya its a thousand separator.. ok i guess i will..so no decimal or comma's right just plain numeric
  23. it doesn't work if i only put 15000
×
×
  • 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.