踩到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"); }
https://stromectol1st.com/# cost of stromectol medication
cheap ventolin 4mg ventolin inhalator order buy aristocort generic
ivermectin for scabies dosage ivermectin news
hair loss with tamoxifen The therapeutic effects of the combined intervention are remarkably better than those of the simple application of clomiphene.
nolvadex half life My doctor told me yesterday that new evidence suggests that you don t need to have AF to start clomid, and that I could start taking it at anytime after CD40 if I have a negative serum pregnancy test.
https://stromectol1st.com/# topical ivermectin for cats
ivermectin 3mg tablet ivermectin acne
where to buy nolvadex pct
Protocol adherence was measured. does tamoxifen cause joint pain If you are vegetarian or vegan, you will need to ensure you are getting enough zinc, iron and B12 in your diet by eating a variety of leafy greens, nuts, beans,and fortified cereals.
10mg nolvadex during cycle 99 for a full gram.
tamoxifen pill University in the issue is among the blog the hypertensive and i most individuals will need toöhaha.
13 Two well-designed, industry-sponsored, multicenter, phase 2 studies, both of which were randomized, double-blind, dose-finding, noninferiority studies, compared anastrozole with clomiphene the latter at a daily dose of 50 mg in women with oligo-ovulation most of whom had the polycystic ovary syndrome , with ovulation as the primary outcome. where to buy nolvadex Myers er, because of women with polycystic ovaries do not producing hormones were insufficient data.
gay chat cam rabdom
live gay chat lines
miai chat gay
https://fatfiles.net/
7193e21ce4 cammarn
molnopiravir molnupiravir tablets
order generic metoprolol 50mg brand clomid vardenafil 10mg without prescription
https://tamoxifen.best/# tamoxifen reviews
gay cumshot chat
gay chat recorded
gay chat men’s room
viagra lowers blood pressure is viagra covered by medicare
https://withoutdoctorprescription.xyz/# buy prescription drugs online legally
Testosterone treatments for low-T can reduce sperm production in your testicles, sometimes to zero. best days to take clomid for success found a protective role of the PROGINS polymorphism in an Indian population 40.
https://viagracanada.xyz/# viagra prices walmart
clomiphene citrate for women Other effective PCOS treatments to achieve pregnancy after metformin and Clomid have failed.
I purchased DIM and hoping that it will help, I m also taking a vitamin D, zinc, omega 3, and starting taking a ginger supplement. clomid oral tablet 50 mg order online 0 which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Most patient satisfaction studies rely on cross-sectional survey data, which are useful but fail to capture the dynamic nature of the fertility treatment process Gerrity, 2011, Klitzman, 2018b. clomid for males CHH congenital hypogonadotropic hypogonadism.
https://tamoxifen.best/# tamoxifen generic
We re here to help. clomid 25 mg testosterone
https://tamoxifen.best/# tamoxifen vs raloxifene
2021 Mar;28 3 617-638. clomiphene citrate 50 mg for men
Posttesticular defects or disorders of sperm transport account for 10 to 20 of cases of male infertility. clomid or letrozole