In a recent project, we encountered a problem to achieve this effect: Click the thumbnail on the pic_small.aspx page and the pic_all.aspx page is displayed. The size of the pic_all.aspx page must be adjusted automatically based on the image size and the image description must be provided, you can also click the previous image or the next image to flip the page. The implementation process is as follows: Pic_small.aspx Code Is: ) "src = .. \ computer \ downloadfiles \ article \ 26 \ <% # images \ product \ + databinder. eval (container. dataitem, "picurl") %> 'width = "118" runat = "server"> Showwindow is saved in the openwindows. js file with the following content: Function showwindow (ID) { Window. Open ('pic _ all. aspx? Id = '+ id,' _ blank ', 'rollbars = no '); } The following code displays the image information on the pic_all.aspx page after a thumbnail is clicked. The pic_all.aspx page is automatically adjusted based on the image size. Place the following code between <SCRIPT> Function window. onload () { VaR OBJ = Document. getelementbyid ("picurl "); Window. resizeTo (obj. offsetwidth + 127, obj. offsetheight + 75 ); } </SCRIPT> Here, picurl is used to display the source image size in pic_all.aspx. I use the HTML control. No matter what method you use, you need to read the image name or path from the database. OBJ. offsetwidth returns the width of the displayed source image, obj. offsetwidth + 127 indicates that the window is 127 pixels larger than the image width, because you need to leave some space for the image description. In this way, the pop-up window can be automatically adjusted according to the image size, and the pop-up page can be edited at will, because the pop-up page is a specified page, no matter what you want to edit, You can process the page as usual. |