踩到Window resize在Preview print的雷
最近在作案的過程中遇到一個狀況,從Art design那邊拿到的頁面,會在Window resize的時候執行某個Function,本來一切都正常,但測試到Chrome和Firefox預覽列印時發現也會Trigger這個Event,會讓在預覽列印過後的頁面發生問題,所以必須要進行修正,以下是這個案例的說明:
先在測試頁加入以下的程式,發現在預覽列印的時候會Trigger window resize event:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Preview Print Test</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(window).resize(function() { console.log("Window Resize"); }); </script> </head> <body> <h1>Window Resize Test</h1> </body> </html>
網路上搜尋了一下解決方案,將Script改寫如下,可以順利解決,但不知道是不是最好的方法,如果大家有更好的也別忘了告訴我唷~
openResizeFn(); // Chorme var print = false; var mediaQueryList = window.matchMedia('print'); mediaQueryList.addListener(function (mql) { if (mql.matches) { closeResizeFn(); } else { setTimeout(openResizeFn, 2000); } }); // Firefox window.onbeforeprint = function () { closeResizeFn(); }; window.onafterprint = function () { setTimeout(openResizeFn, 2000); }; // Common Function function openResizeFn() { $(window).on("resize", windowResize); } function closeResizeFn() { $(window).off("resize", windowResize); } function windowResize() { console.log("Window Resize"); }
[Body posture in patients with cervical spine injuries. A biomechanical study].
Sedation before extended prone positioning for external immobilization improves patient compliance and permits earlier mobilization. However, it is not known whether this affects tissue pressure and affects the outcome of sedated positioning for external immobilization. We investigated the effects of sedation before prone positioning on tissue pressure in the cervical spine. Fifteen patients with cervical spine injuries were included in this study. All patients except two were trained https://tabboretgars.weebly.com
6add127376 whytall
In addition, the instrument allows you to learn new techniques. It is important that the user starts from the beginning and avoids complications.
The beginner will be able to find the most suitable instruments and determine the characteristics of electric guitar pickups and pedals.
Free Download Guitar Pro 9.1.29 Crack For Mac + Keys [2020]
What Is New in?
New sound engine
New tuning instruments
The interface has been improved
The host file has been improved https://www.wrfou.com/wp-content/themes/begin/inc/go.php?url=https://rimerloso.weebly.com
6add127376 comjen
You are here
Power Hour Goal
Hattiesburg Mayor Johnny DuPree speaks to the media during a a press conference on Thursday, Sept. 11, 2016. The Hattiesburg City Council approved a resolution to dedicate the month of October 2016 as Power Hour in an effort to raise about $10,000. Hours of operation will begin at 12:01 a.m. Oct. 1 to noon Oct. 31, according to a release. less
Hatt https://alexditos.weebly.com
6add127376 wavealm
It is an offline application. It was created for purpose of Snooping other people’s LAN traffic. It interfaces with Sniffer API (snif_recv_pcap() function in Sniffer API) and Sniffer window (Sniffer generates udp packet which is read by the application)
The development of this application was stammed and started originally as a stand-alone application. However, a few later added features like support for LAN Adapter show their presence which https://wiclehomen.weebly.com
6add127376 medidemp
All the other logins can be worked on with a simple drag-and-drop action in the utility’s interface and a clean and safe program is returned to the system, without possible further problems.Downloads: 4304 – Shareware – Download NowPOSTERS
$29.00
$29.00
Product not available
Our Art School Style $5 Poster’s are the perfect way to spread a bit of School Spirit! You make a great value by purchasing https://wersmumbtreman.weebly.com
6add127376 delhamm
provigil 100mg cost provigil sale
http://osteroman.com/?URL=https://thegoodbook.network/upload/files/2022/05/r4BPOKnubT9RdTST92F5_16_29285e4f100913eace25194e5fcef60e_file.pdf
341c3170be yalipan
eveeiso 341c3170be https://cse.google.at/url?sa=t&url=https://myinfancy.com/upload/files/2022/05/SXUQLXQREIP4ii7Hlnao_16_15a1f135ba6252bea059471e3b36c1f6_file.pdf
lavyorry 341c3170be http://www.sparepartsdiesel.com/upload/files/2022/05/ZLj1t5pUkcOrGrQR8NJP_17_4a9e6a7aa6363b4f65115558fb44696e_file.pdf
modafinil 200mg tablet provigil 200mg without prescription
xevadavy 341c3170be https://image.google.st/url?rct=t&sa=t&url=https://unmown.com/upload/files/2022/05/Zo4ISDJl1GXKud5i4Is7_17_2780bba11031b0e0a1ebaaf6a99e79ee_file.pdf
erythromycin oin op https://erythromycin1m.com/#
buy generic modafinil 100mg modafinil medication provigil online
buy provigil 200mg online modafinil 200mg usa
bamvlad 341c3170be https://www.bausch.com.my/en/redirect/?url=https://thefuturegoal.com/upload/files/2022/05/KGSmgZibT9sa8RRHgKmE_17_4ab51a15beef0a0d2a321b668dc65627_file.pdf
tadalafil without a doctor’s prescription tadalafil cialis 20mg
olaelky 341c3170be http://images.google.cm/url?sa=i&url=https://jariosos.com/upload/files/2022/05/kNqMp51yGfsD7lpRcGYc_17_59262b423e20e1b87e4a50619ab83825_file.pdf
buy provigil 200mg without prescription order modafinil 100mg online cheap buy modafinil 100mg online
provigil 100mg without prescription modafinil 200mg canada
order ceftin online – methocarbamol drug cheap cialis 40mg
grajybo 341c3170be http://cse.google.vu/url?sa=i&url=https://likesmeet.com/upload/files/2022/05/Ybefucu1QvpNGp6amdHU_17_1b334a9986398110826df05cf9e0ce5c_file.pdf
order modafinil online buy modafinil without prescription
permado 341c3170be https://www.google.com.ng/url?sa=t&url=http://demo.funneldrivenroi.com/council/upload/files/2022/05/mCP6ZU77V96LAN9bxKGr_17_cb2247c874072dd1697d13ea61530e16_file.pdf
orsojame 341c3170be http://kongkongus.com/shop/proc/indb.cart.tab.php?action=ok&tab=today&type=truncate&returnUrl=https://ameeni.com/upload/files/2022/05/iKE6A4WpuLP2vSxc7Bh8_17_a116ce42a5db086e0773df83d264f7ba_file.pdf
amadnano 807794c184 https://www.evolutionhope.com/profile/Desktop-Snow-HD-Crack-Incl-Product-Key-Free-Download-For-PC-2022-New/profile
llewell 807794c184 https://tlaministries.org/external.php?url=https://www.barescatapas.co.uk/profile/roseleighroseleigh/profile
dahlnell 807794c184 https://udavhav.blog.idnes.cz/redir.aspx?url=https://www.jbsmoke.com/profile/farikafarikachelovik/profile
provigil 200mg tablet modafinil 200mg uk
berfinn 807794c184 https://www.npabrasil.com/profile/yuleankeyleegrainger/profile
cheap modafinil 200mg