สอบถามเรื่องสคริปคำนวณความกว้าง ความสูง java ค่ะ

สอบถามเรื่องสคริปคำนวณความกว้าง ความสูง   java ค่ะ 



คืออยากให้เวลา เอารูปจากฐานข้อมูลที่รับเข้ามาไม่ต้องคำนวณความกว้าง ความสูงอีกค่ะ  เพราะในสคริป มันเอาคำนวณอีกที อะค่ะ



แก้หลายจุดแล้วก่ยังไม่ได้อะค่ะ





<a id="goLeft">&nbsp;</a>

              <div id="lookbookContainer">

                    <div id="lookbookItemHolder" class="scroll-pane horizontal-only">

                        <div id="itemWrapper">

                   <? for($x=0;$x<$result_g;$x++){

                        $sql_pic=get_a_line("select * from port_img  where port_id ='".$sql_g[$x]['port_id']."' order by port_img_id asc ");

                        ?>


                            <div class="lookbookItem"><img src="img_port/small/1318565011-0.jpg" />  

                             

                             <div class="lookbookItemInfo">

                                    <span class="itemName"> </span>

                                    <span class="itemDesc"><P><?=$sql_g[$x]['port_detail_'.$_SESSION["language"]]?></span>                              </div>

                           </div>       

                        <? } ?>

                            

                      </div>

                   </div>

              </div>

             <a id="goRight">&nbsp;</a>







<script type="text/javascript">

            $(document).ready(function () {



                $('#startPageFlash').css('height', 0);

               



                $('#sb-container').addClass('lookbook');



                var width = 0;

                $('.lookbookItem').each(function () {

                    width += $(this).width();

                    width += 16; //แถวความกว้าง

                });

               

                $('#itemWrapper').css('width', width);

                $('#lookbookContainer').css('width', $(window).width());



                var height = $('#lookbookContainer').height();

                height += 30;

                $('.articleContent').css('height', height);



                if (width < $(window).width()) {

                    $('#goLeft').css('display', 'none');

                    $('#goRight').css('display', 'none');

                    height -= 20;

                    $('.articleContent').css('height', height);

                }



                $('#lookbookItemHolder').jScrollPane();



                $('.jspContainer').bind('mousewheel', function (event, delta) {

                    if (delta != null) {

                        if (delta > 0) {

                            moveRight();

                        }

                        else {

                            moveLeft();

                        }

                    }

                });



                var moveItemsContainer = (0.1 * (($('#itemWrapper').width()) - ($(window).width())));

                var moveScrollbar = (0.1 * (($('.jspHorizontalBar').width()) - ($('.jspDrag').width())));



                function moveLeft() {

                    var currentContainerPosition = $('.jspPane').position();

                    var currentScrollbarPosition = $('.jspDrag').position();



                    var newContainerPosition = (currentContainerPosition.left - moveItemsContainer);

                    var newScrollbarPosition = (currentScrollbarPosition.left + moveScrollbar);



                    var compare = 0 - (($('#itemWrapper').width()) - ($(window).width()));



                    if (newContainerPosition > compare) {

                        $('.jspPane').css('left', newContainerPosition);

                        $('.jspDrag').css('left', newScrollbarPosition);

                    } else {

                        $('.jspPane').css('left', compare);

                        $('.jspDrag').css('left', (($('.jspHorizontalBar').width()) - ($('.jspDrag').width())));

                    }



                };



                function moveRight() {

                    var currentContainerPosition = $('.jspPane').position();

                    var currentScrollbarPosition = $('.jspDrag').position();



                    var newContainerPosition = (currentContainerPosition.left + moveItemsContainer);

                    var newScrollbarPosition = (currentScrollbarPosition.left - moveScrollbar);



                    if (newScrollbarPosition > 0) {

                        $('.jspPane').css('left', newContainerPosition);

                        $('.jspDrag').css('left', newScrollbarPosition);

                    } else {

                        $('.jspPane').css('left', 0);

                        $('.jspDrag').css('left', 0);

                    }

                };



                $("#goLeft").click(function () {

                    moveRight()

                });



                $("#goRight").click(function () {

                    moveLeft()

                });



            });

        </script>
14 ต.ค. 2554 1 1,190


    ให้โอกาศถามใหม่อีกที :46:


#1
ความคิดเห็น
ไฟล์อัปโหลด ชนิด jpg, jpeg ขนาดไฟล์ไม่เกิน 1024
^