Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <img src="g1a.png" id="modele" style="display: none;"></img>
- <script>
- var source = document.getElementById("modele"), rw = source.naturalWidth, rh = source.naturalHeight;
- if (rw / rh >= ($(window).width()) / ($(window).height() - 60))
- {
- var param = ' width="' + window_width + '" ';
- }
- else {
- var param = ' height="' + window_height + '" ';
- }
- var window_height = $(window).height() - 60;
- var window_width = $(window).width();
- $('#pic').html('<img src="g1a.png" width="' + window_width + '" height="' + window_height + '"></img>');
- $(function()
- {
- $('#sel_div').css('top', 30 - $('#sel').height() / 2);
- $('#sel').change(function()
- {
- var selected = $(this).val();
- $('#pic').html('<img src="' + selected + '.png" ' + param + '></img>');
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement