webForumDet fria alternativet

Slideshow och Explorer

6 svar · 1 518 visningar · startad av Pelletsteknik

PelletsteknikMedlem sedan feb. 200844 inlägg
#1

Jag använder "slideshow" på min sida och och det verkar inte fungera med alla webläsare.

Den stänger igen direkt, så att jag kan inte klicka vidare.

<!-- ========== CSS ========== -->
<style type="text/css">
#shipping-estimate-module {
	margin-left: auto;
	margin-right: auto;
}
#location-fields, #shipping-quotes { /* Needed to display next to each other for content modules in 1.5.0.x */
	display: inline-block;
	vertical-align: top;
}
#location-fields {
	margin-right: 25px;
}
#shipping-estimate-module select {
	width: 160px;
}
#shipping-estimate-module input {
	width: 155px;
}
#estimate-button {
	margin: 5px 0 5px 42px;
}
#estimate-button span {
	height: 15px; /* To the make loading gif the same height as "Estimate" */
}
#estimate-button img {
	padding: 0 17px 0 16px; /* To the make loading gif the same size as "Estimate" */
}
#quotetable {
	background: #F8F8F8;
	border: 1px solid #DDD;
	margin: 0;
	padding: 0 !important;
	width: 100%;
}
#quotetable td, #quotetable a {
	font-size: 11px;
}
.leftpadded {
	padding-left: 15px;
}
</style>

<!-- ========== HTML ========== -->
<div id="shipping-estimate-module" class="box"<?php if (!defined('VERSION') || VERSION < 1.5) { echo ' style="width: 180px"'; } ?>>
	<div class="top box-heading">
		<?php if (!defined('VERSION') || VERSION < 1.5) { ?><img src="catalog/view/theme/default/image/shipping.png" alt="" /><?php } ?>
		<?php echo $heading_shippingestimate; ?>
	</div>
	<div class="middle box-content">
		<div id="location-fields">
			<div<?php if ($this->config->get('shippingestimate_hide_country')) echo ' style="display: none"'; ?>>
				<strong><?php echo $entry_country; ?></strong>
				<select id="shipest_country_id" name="shipest_country_id" onchange="loadzones(this.value)">
					<option value="FALSE"><?php echo $text_select; ?></option>
					<?php foreach ($countries as $country) { ?>
						<option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
					<?php } ?>
				</select>
			</div>
			<div<?php if ($this->config->get('shippingestimate_hide_zone')) echo ' style="display: none"'; ?>>
				<strong><?php echo $entry_zone; ?></strong>
				<select id="shipest_zone_id" name="shipest_zone_id"></select>
			</div>
			<div<?php if ($this->config->get('shippingestimate_hide_postcode')) echo ' style="display: none"'; ?>>
				<strong><?php echo $entry_postcode; ?></strong>
				<input type="text" id="shipest_postcode" name="shipest_postcode" onkeydown="if (event.keyCode == 13 || event.which == 13) getquote();" />
			</div>
			<div id="estimate-button">
				<a onclick="getquote()" class="button"><span><?php echo $button_estimate; ?></span></a>
			</div>
		</div>
		<div id="shipping-quotes">
			<!-- shipping quotes table goes here -->
		</div>
	</div>
	<?php if (!defined('VERSION') || VERSION < 1.5) { ?><div class="bottom">&nbsp;</div><?php } ?>
</div>

<!-- ========== Javascript ========== -->
<script type="text/javascript"><!--
	$('#shipping-quotes').hide();
	
	var moduleWidth = $('#shipping-estimate-module').width();
	if (moduleWidth > 800) {
		$('#shipping-quotes').width('70%');
	} else if (moduleWidth > 600) {
		$('#shipping-quotes').width('60%');
	} else if (moduleWidth > 200) {
		$('#shipping-quotes').width('50%');
	}
	
	function loadzones(country_id) {
		$('#shipest_zone_id').load('index.php?route=checkout/address/zone&country_id=' + country_id + '&zone_id=', function() {
			$('#shipest_zone_id').val('<?php echo $default_zone; ?>');
			<?php if ($this->config->get('shippingestimate_hide_zone')) { ?>
				if ($('#shipest_zone_id').val() == 'FALSE') {
					$('#shipest_zone_id').val($('#shipest_zone_id option:selected').next().val());
				}
			<?php } ?>
		});
	}
	
	function getquote() {
		$('#estimate-button span').html('<img src="catalog/view/theme/default/image/ajax_shipping.gif" />');
		$('#shipping-quotes').slideUp('slow', function() {
			$.post(
				"index.php?route=module/shippingestimate/estimate",
				{country_id: $('#shipest_country_id').val(), zone_id: $('#shipest_zone_id').val(), postcode: $('#shipest_postcode').val(), route: '<?php echo $this->request->get['route']; ?>'},
				function(data) {
					$('#shipping-quotes').html(data);
					$('#shipping-quotes').slideDown('slow', function() {
						$('#estimate-button span').html('<?php echo $button_estimate; ?>');
					});
				}
			);
		});
	}

	function applyshipping(quote_id) {
		$('#shipping-quotes').slideUp('slow', function() {
			$.post(
				"index.php?route=module/shippingestimate/apply",
				{shipping_method: quote_id},
				function(data) {
					$('#shipping-quotes').html(data);
					$('#shipping-quotes').slideDown('slow');
				}
			);
		});
	}
	
	$('#shipest_country_id').val('<?php echo $default_country; ?>');
	loadzones(<?php echo $default_country; ?>);
	$('#shipest_postcode').val('<?php echo $default_postcode; ?>');
//--></script>
@ndersMedlem sedan juni 200032 969 inlägg
#2

Visa hur den färdiga koden som skickas till webbläsaren ser ut. Vi har inte inbyggda php-tolkar i våra hjärnor.

Ge oss gärna URL också så vi kan se hur det beter sig.

PelletsteknikMedlem sedan feb. 200844 inlägg
#3

http://shop.pelletsteknik.se/index.php

Hur vet jag vilken kod det är som skickas till webläsaren?
Det fungerar ej med Explorer.

@ndersMedlem sedan juni 200032 969 inlägg
#4

Högerklicka i webbläsaren och välj "Visa källa".

PelletsteknikMedlem sedan feb. 200844 inlägg
#5

Från webläsaren.

</div>
			<div id="estimate-button">
				<a onclick="getquote()" class="button"><span>Beräkna</span></a>
			</div>
PelletsteknikMedlem sedan feb. 200844 inlägg
#6

Från webläsaren.

}
	
	function getquote() {
		$('#estimate-button span').html('<img src="catalog/view/theme/default/image/ajax_shipping.gif" />');
		$('#shipping-quotes').slideUp('slow', function() {
			$.post(
				"index.php?route=module/shippingestimate/estimate",
				{country_id: $('#shipest_country_id').val(), zone_id: $('#shipest_zone_id').val(), postcode: $('#shipest_postcode').val(), route: '<b>Notice</b>:
PelletsteknikMedlem sedan feb. 200844 inlägg
#7

Detta är ajax_add.js

$(document).ready(function () {
	$('#add_to_cart').removeAttr('onclick');

	$('#add_to_cart').click(function () {
		$.ajax({
			type: 'post',
			url: 'index.php?route=module/cart/callback',
			dataType: 'html',
			data: $('#product :input'),
			success: function (html) {
				$('#module_cart .middle').html(html);
			},	
			complete: function () {
				var image = $('#image').offset();
				var cart  = $('#module_cart').offset();
	
				$('#image').before('<img src="' + $('#image').attr('src') + '" id="temp" style="position: absolute; top: ' + image.top + 'px; left: ' + image.left + 'px;" />');
	
				params = {
					top : cart.top + 'px',
					left : cart.left + 'px',
					opacity : 0.0,
					width : $('#module_cart').width(),  
					height : $('#module_cart').height()
				};		
	
				$('#temp').animate(params, 'slow', false, function () {
					$('#temp').remove();
				});		
			}			
		});			
	});			
});
136 ms totalt · 3 externa anrop · v20260731065814-full.30151723
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
133 ms — hämta tråd, inlägg och bilagor (db)